my (@tmp,$template); for (0 .. 4) { my ($test,$str); $str = "test   text $_"; $test{'TRY'} = escapeHTML($str); push (@tmp,\%test); } $template->param(TMP_LOOP => \@tmp);