while (my $line = <$file>) { chomp ($line); my ($in_game, $in_three, $in_two, $in_one) = split (',', $line); if ($in_game eq 'G01') { $G01totals{$in_three} += 3; $G01totals{$in_two} += 2; $G01totals{$in_one} += 1; } if ($in_game eq 'G02') { $G02totals{$in_three} += 3; $G02totals{$in_two} += 2; $G02totals{$in_one} += 1; } if ($in_game eq 'G03') { $G03totals{$in_three} += 3; $G03totals{$in_two} += 2; $G03totals{$in_one} += 1; } }