- or download this
my $template;
eval {
$template = new HTML::Template(filename => 'foo.tmpl');
...
eval {
print $template->output();
};
- or download this
<TMPL_IF debug>
<ul>
<TMPL_LOOP debuglog>
...
<TMPL_ELSE>
... the non-debug page ...
</TMPL_IF>
- or download this
my @debuglog = ();
if ( ... ) {
...
...
$template->parameter(debug => 0 != @debuglog);
$template->parameter(debuglog => \@debuglog);
- or download this
sub debuglog {
push @debuglog, {item => $_} for ( @_ );
}
- or download this
debuglog("Some message") if ( ... );