my $sum = 0; $sum += $_ foreach @$bscores; $averages[$bowler] = int($sum/@$bscores);