CGI-FastTemplate

 view release on metacpan or  search on metacpan

FastTemplate.pm  view on Meta::CPAN

refer to templates with names that are indepandant of filenames.)

TIP: Since define() does not actually load the templates, it is faster
and more legible to define all the templates with one call to define().

=head2 define_nofile(HASH)   alias: define_raw(HASH)

Sometimes it is desireable to not have to create a separate template file
for each template (though in the long run it is usually better to do so).
The method define_nofile() allows you to do this.  For example, if you
were writing a news tool where you wanted to bold an item if it was
"new" you could do something like the following:

    my $tpl = new FastTemplate();

    $tpl->define_nofile(    new   => '<b>$ITEM_NAME</b> <BR>',
                            old   => '$ITEM_NAME <BR>');

    if ($new)
    {
        $tpl->parse($ITEM   => "new");



( run in 0.284 second using v1.01-cache-2.11-cpan-5dc5da66d9d )