in reply to Re^2: Problem with hashes
in thread Problem with hashes

Rule one for debugging: checking is better than knowing for sure. So try copying the following code before your print and look what is happening ...:
if (exists ($hash{$word[-1]})) { print("$word[-1] OK\n"); } else { print("$word[-1] isn't in the hash\n"); }