open scores, "a:/scores.txt" || die "what did you idiots do with the scores file."; while(){ chomp; my (@names, @score) = split /:/; $dev=1; for($ctr=0; $ctr<@score; $ctr++){ print "@score\n"; $a = $a + @score; $dev++; print "$dev"; } $b = $a / $dev; print "the average of the scores is $b "; }