my @loop_data = (); push(@loop_data, \%hash); my $template = HTML::Template->new(filename => 'fun.tmpl'); my $CGI = CGI->new(); $template->param(template_loop => \@loop_data); print $CGI->header( ); print $CGI->title("Here is your output."); print $template->output; exit;