I think its the EXPOSE_BLOCKS option that you maybe after?
use strict;
use warnings;
use Template;
my $tt = Template->new({
INCLUDE_PATH => '.',
EXPOSE_BLOCKS => 1,
});
$tt->process( 'test.tt/header', { tit => 'Weekly report' } );
for my $day qw(Mon Tues Weds Thurs Fri Sat Sun) {
$tt->process( 'test.tt/body', { day => $day, result => int rand 999 } );
}
$tt->process( 'test.tt/footer', { tit => '1st Jan 1999' } );
test.tt:
[% BLOCK header %]
[% tit %]
[% END %]
[% BLOCK body %]
* Results for [% day %] are [% result %]
[% END %]
[% BLOCK footer %]
Correct for week commencing [% tit %]
[% END %]
Will produce this report (with random numbers):
Weekly report
Correct for week commencing 1st Jan 1999
Hope that helps.
/I3az/