my @files_param; for (@files) { push @files_param, { NAME => $_ }; } $template->param(\@files_param);