in reply to Mysterious hash problem
I'm not sure how your input file is generated/populated, but it might be worth thinking about doing more than chomp in your foreach loop - such as dealing with leading/trailing whitespaces and capitalization. Consider the the following quoted strings and if they all should be counted under the same key in your hash:
Another thing to consider is that using %dict and $dict might lead to some confusion for yourself later. The same could happen with using $wd and $wds.
Just sharing the thoughts that popped into my mind when looking over your code. Not saying that any of the above is necessarily "wrong", but those are the types of things that have gotten me into trouble with my code.
|
|---|