[% FOREACH n IN [0 .. array1.size ] %] first array: [% array1.$n %] second array: [% array2.$n %] [% END %]
This combines string interpolation with array accessing using the .N operator (e.g. array.0, array.1, etc.)
You might have to interpolate ${array1.size} - that's why I say it's untested.
In reply to Re: Random access of array elements in Template::Toolkit
by pc88mxer
in thread Random access of array elements in Template::Toolkit
by magica
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |