sub score_count { my @arr = shift; my $total = 0; foreach my $score (@arr) { print "@$score "; ##prints actual values; If @ taken out, values printed are like ARRAY(0x95533e0) $total += @$score; ##if @ is taken out the summation is somewhere ~140915576; however, with the @, the values are still incorrect. } print "$total\n"; return $total; }