my $split; for (@LINES) { my ($date,$type,$amt,$bal) = split ('&', $_); my $hash_ref = { Date => $date, Type => $type, Amount => $amt, Ending_Balance => $bal, }; push(@$split,$hash_ref); } $template->param(TRANSACTIONS => $split);