for my $row (@myArray) { my $sum = 0; for ($col = 1 .. $no_of_seq - 1) { $sum += $row[$col]; } print "$row[0] $sum\n"; }