in reply to Re^6: reading files in @ARGV doesn't return expected output
in thread reading files in @ARGV doesn't return expected output

This:
for ($a=0; $a<=$#columns; $a++) { for ($b=0; $b<=$#columns; $b++) { print "$list[$a][$b] "; # for testing } print " \n"; }
should probably avoid using the $a and $b variables, which have a special purpose (for sorting).

In general, you should probably try to avoid using the C-style for loop and array subscripts when you can, because it can be made significantly simpler and easier by iterating directly over the values (no off-by-one errors, no out-of-range errors).

my @AoA = ([1, 2, 3], [4, 5, 6], [7, 8, 9]); # an array of arrays for +testing purpose for my $row (@AoA) { for my $col (@$row) { print "$col "; } print "\n"; }
which prints:
1 2 3 4 5 6 7 8 9

And if you need to make some calculations:

my @AoA = ([1, 2, 3], [4, 5, 6], [7, 8, 9]); for my $row (@AoA) { my ($sum, $count) = (0, 0); for my $col (@$row) { $sum += "$col "; $count ++; } print "Average: ", $sum / $count, "\n" if $count; }
which will print the three computed averages:
Average: 2 Average: 5 Average: 8
Update: The comment about $a and $b was made earlier by zentara, but below in this thread, I had not noticed it when I mentioned that.