Site icon Dipin Krishna

Perl: Process an array or a hash inside a Template

perl

Process and array or a hash inside a perl template

#Print an Array named items
[% FOREACH item IN items -%]
   [% item %]
[% END -%]
 
#Print a HASH named items
[% FOREACH key IN items.keys.sort -%]
   [% key %]: [% terms.$key %]
[% END -%]

Enjoy coding! 🙂

Exit mobile version