#!perl use 5.12.0; use warnings; use List::Util qw{sum}; my @table = (); while () { push @table, [ split ]; } for my $col (0 .. $#{$table[0]}) { say qq{Column $col = }, sum map { $table[$_][$col] } (0 .. $#table); } __DATA__ 1 2 3 4 5 6 1 2 3 4 5 6