Search code examples
perltemplate-toolkit

Iterate numbers Template Toolkit


How to iterate simple numbers in Template Toolkit instead of iterating over hash with FOREACH?

All I could find in Documentation of TT was FOREACH.


Solution

  • It should be possible to build something like this:

    [% FOREACH i IN [ 1 .. 10 ] %]
      [% i %]
    [% END %]
    

    See also Template Toolkit Documentation on Variables