I'm trying to find a way to have a Template output to multiple variables.  I tried 
just setting predefined variables to the output of blocks:

use Template;

my $t = new Template();

my $template = qq~
    [% FOREACH page = PAGES %]
        [% OUT.loop.count = BLOCK %]
            Page [% loop.count %].
        [% END %]
    [% END %]
~;

my $vars = {
    PAGES => [1, 2, 3, 4, 5, 6, 7],
    OUT   => []
};

$t->process(\$template, $vars);


That didn't work. I tested just setting normal scalar variables within the template, 
since I figured my OUT.loop.count stuff was wrong; still no workie.  I'm guessing the 
variables passed to TT are cloned, which makes them read-only, right?  Is there any 
other way to output select processed content to multiple variables?



Reply via email to