- or download this
<!-- foo.tmpl -->
...
</tmpl_loop>
</select>
...
- or download this
### foo.pl ###
my @menu;
push @menu, { item => $_, selected => $_ eq $state } for 1..6;
$t->param( menu => \@menu );
- or download this
my @nums = (1..6);
my (@menu, %option, $selected);
...
# Send the menu to the template;
$t->param( menu => \@menu );