my $loop_data=[ {Auction=>'Test1', ID=>'1'}, {Auction=>'Test2', ID=>'2'}, {Auction=>'Test3', ID=>'3'}, {Auction=>'Test4', ID=>'4'}, ]; $template->param(table1 => $loop_data); #### my @loop_data=( {Auction=>'Test1', ID=>'1'}, {Auction=>'Test2', ID=>'2'}, {Auction=>'Test3', ID=>'3'}, {Auction=>'Test4', ID=>'4'}, ); $template->param(table1 => \@loop_data); #### my $arrayref = $dbi->selectall_arrayref("select statement from sql") $arrayref = convert_to_hashes( $arrayref); $template->param(table1 => $arrayref);