use strict; use warnings; use Template; my $tt = <<'TT'; [% # this is a comment to the end of line foo = 'bar' %]

You might have an array in your TT

[% #foo = bar[5]; %]

bw, bliako

[%# placing the '#' immediately inside the directive tag comments out the entire directive %] A nested tag: [% # a comment abc = 1; [%# xyz %] %] TT use Template; my $parser = Template->new(); my $output = $parser->process(\$tt, { bar => [1,2,3,4,5]}) or die $parser->error; print $output; __END__ file error - parse error - input text line 16-18: unexpected token (%#) [% # a comment abc = 1; [%# xyz %]