in reply to Counting instances in a hash from an array
When comparing strings, use eq, not ==. Using the latter will convert the strings into numbers before comparing them.
The proper syntax for if is if (...) { ... }. The parens are missing in your code.
Update: The OP updated his node to include sample data. It seems he is still storing the score (a number he wishes to change) as the key to the hash. He was told this was a bad idea, and he was given several solutions to his question in an earlier post.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Counting instances in a hash from an array
by Melly (Chaplain) on Mar 23, 2006 at 23:22 UTC | |
by ikegami (Patriarch) on Mar 23, 2006 at 23:57 UTC |