HTML::Template

http://html-template.sourceforge.net

This is a Perl module that MiniWiki uses as a basis for templates.

Examples

A HTML::Template object can be created using a pre-existing string (scaler), which could be pulled from a database or what have you:

$t = HTML::Template->new(
  scalarref => \$template_text,
  die_on_bad_params => 0
);

More commonly, templates are stored on the filesystem. HTML::Template has built in caching which is fairly sophisticated. It will check whether the file has been modified... if not, the previously loaded template (which should be in memory already) will be used:

$t = HTML::Template->new(
  filename => "$datadir/template",
  cache => 1,
  die_on_bad_params => 0
);