#Read all transactions my $lref; my $line = ''; my @fields = (); my @alltrans = (); open( ALL, " ) { chomp; $line = $_ . ' '; #ugly as only copes with one trailing null field @fields = split( ',', $line ); $fields[-1] = ( $fields[-1] eq ' ' ) ? '' : $fields[-1]; $lref = [ @fields ]; push( @alltrans, $lref ); } close ALL; print Dumper @alltrans;