#!/usr/bin/perl use strict; use warnings; use Carp 'verbose'; use HTML::Template; my $temp_text = < EOT my $tpl = HTML::Template->new(scalarref => \$temp_text); my @ary = map {n_event => $_, sel=>$_,t_event=>$_}, qw(foo bar baz cliche trope); $tpl->param(TYPE=>\@ary); print $tpl->output; __END__