A point the other posters didn't mention, is that your variable data looks more like an array (@WORD) than a hash (%WORD). I don't understand what you're doing to it later - I'm only in chapter 7 of "Learning Perl" - so maybe you
need a hash. But ask yourself if your lookup would work just as well with an array variable?