Scrabble cheater in Perl