# file test.pl use HTML::Template; use strict; use warnings; my $template = HTML::Template->new(filename => 'test.tmpl'); my @xml = ( { parent => 'tag1', common_value => 'XXX', }, { parent => 'tag2', common_value => 'YYY', }, { parent => 'tag3', common_value => 'XXX', }, ); # params $template->param( loop => \@xml ); print $template->output(); # file test.tmpl <> > # output XXX YYY XXX