foreach (@data) { my $columnsum += $_->[$colnum]; } print $columnsum; # is undef, and would give a strict error