in reply to Need help hashing this out. . .

Have you printetd out the value of team? Do it with a delim around it ie print "($team)\n";.
My guess is that the records are coming back with trailing whitespace, or that the capitalization is different. But probably the whitespace. (Which you can trim with: $team =~ s/^\s*(.*?)\s*$/$1/; among other ways).

-pete
Entropy is not what is used to be.