TransactionDATETypeAmountEnding Balance
Transaction:
#### my $template = HTML::Template->new( filename => 'atm_choose.tmpl', die_on_bad_params => 0 ); my @LINES; while () { chomp; push @LINES, $_; } my $split; for (@LINES) { my @row = split ('&', $_); push @{$split}, $_; } $template->param(TRANSACTIONS => $split); print header, $template->output; __DATA__ 10/02/2013 & closing balance & 0 & 1000 11/02/2013 & debit & 100 & 900 12/02/2013 & credit & 1000 & 1900 #### while () { chomp; push @LINES, $_; } my @split; for (@LINES) { my @row = split ('&', $_); push @split, \@row; } $template->param(TRANSACTIONS => [{Date => $split[0][0], Type => $split[0][1], Amount => $split[0][2], Ending_Balance => $split[0][3]}, {Date => $split[1][0], Type => $split[1][1], Amount => $split[1][2], Ending_Balance => $split[1][3]}, {Date => $split[2][0], Type => $split[2][1], Amount => $split[2][2], Ending_Balance => $split[2][3]} ]);