in reply to Iterating hash of blessed hashes
ron7: As BrowserUk suggests, your OPed code has a problem on the first pass through the loop because you are comparing against $rating, which is uninitialized on that occasion. (I'm not sure how you missed this warning. You did use warnings and strictures, didn't you?) However, initialization to zero will be a problem if a rating can ever be negative (a point on which your OP is silent) and all the ratings happen to be so, in which case you will get a bunch more warnings and also a wrong answer!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Iterating hash of blessed hashes
by ron7 (Beadle) on Feb 21, 2011 at 05:02 UTC |