Text::NeatTemplate is a fast, middleweight template engine.
SYNOPSIS
use Text::NeatTemplate;
my $tobj = Text::NeatTemplate->new();
$result = $tobj->fill_in(data_hash=>�ta,
show_names=>%names,
template=>$text);
This module provides a simple, middleweight but fast template engine, for when you need speed rather than complex features, yet need more features than simple variable substitution.
Markup Format
The markup format is as follows:
{$varname}
A variable; will display the value of the variable, or nothing if that value is empty.
{$varname:format}
A formatted variable; will apply the formatting directive(s) to the value before displaying it.
{?varname stuff [$varname] more stuff}
A conditional. If the value of 'varname' is not empty, this will display "stuff value-of-variable more stuff"; otherwise it displays nothing.
{?var1 stuff [$var1] thing [$var2]}
This would use both the values of var1 and var2 if var1 is not empty.
{?varname stuff [$varname] more stuff!!other stuff}
A conditional with "else". If the value of 'varname' is not empty, this will display "stuff value-of-variable more stuff"; otherwise it displays "other stuff".
This version can likewise use multiple variables in its display parts.
{?var1 stuff [$var1] thing [$var2]!![$var3]}
{&funcname(arg1,...,argN)}
Call a function with the given args; the return value of the function will be what is put in its place.
{&MyPackage::myfunc(stuff,[$var1])}
This would call the function myfunc in the package MyPackage, with the arguments "stuff", and the value of var1.
Note, of course, that if you have a more complicated function and are processing much data, this will slow things down.
Product's homepage
Requirements:
· Perl