in reply to Re^2: HTML::TEMPLATE Simutaneous Templates
in thread HTML::TEMPLATE Simutaneous Templates

Trivial SSCCE:

#!/usr/bin/env perl use strict; use warnings; use HTML::Template; my @sources = ( "Hello <TMPL_VAR NAME=FOO>\n", "Goodbye <TMPL_VAR NAME=FOO>\n", ); my @templates; # Create and populate 2 templates with one loop for my $source (@sources) { my $tmpl = HTML::Template->new (scalarref => \$source); $tmpl->param (FOO => 'StrangeDucks'); push @templates, $tmpl; } # Output from the two teamplates for my $t (@templates) { print $t->output }

See also the HTML::Template Tutorial.

(Edit: minor update to improve generality.)