foreach my $score (@arr) { foreach my $i (@$score) { $total += $i; } }