in reply to Template::Toolkit: better way to generate variable names?
Did you try this?
Anyway, apply here the
usual arguments against
variable variable names. Use a hash or an array, if you can.
[% foo_1 = 'value1' foo_2 = 'value2' foo_3 = 'value3' foo_4 = 'value4' foo_5 = 'value5' %] [% FOREACH n = [ 1 .. 5 ] %] [% 'foo_' _ n %] is [% ${ "foo_$n" } %] [% END %]
Update: I misread the question. See geektron's reply.
In Section
Seekers of Perl Wisdom