# First, read the long list of players and scores into a hash # Then, read the short list of important players, and print # their scores from the hash open( LIST, "score" ) || die "can't open score file\n"; while () { chomp; ($name,$score) = split(/,/); $scores{$player} = $score; } open( TEAM, "player" ) || die "can't open player file\n"; while () { chomp; print "$scores{$_} $_\n"; }