use strict; use warnings; use HTML::Template qw(); my $tmplStr = < TMPL my $tmpl = HTML::Template->new(scalarRef => \$tmplStr); my @pictures = ( {file => 'wibble.jpg', path => '/here/there/everywhere'}, {file => 'wobble.jpg', path => '/here/there/everywhere'}, {file => 'floop.jpg', path => '/here/there/elsewhere'}, ); $tmpl->param( className => 'pinkAsAnything', pictures => \@pictures, ); print $tmpl->output();