You could turn that into a module and upload it as something like Games::GuessWord::Solver. Could come in handy on IRC and WWW.
As for better guessing, you could also add previously unknown words to your dictionary (automatic word learning) and/or use Markov chains and/or even some basic AI module (Baysean statistics, Neural net, ...).