sub score_count { my @arr = shift; my $total = 0; foreach my $score (@arr) { print "@$score "; foreach my $i (@$score){ $total += $i; } } print "$total\n"; return $total; }