my $total = 0; $total += $_ for @score; print "$total\n"; #### my $total = 0; for (my $ctr=0; $ctr<@score; $ctr++) { $total += $score[$ctr]; # maybe use $ctr for some other purpose as well... } print "$total\n";