You have $highest=$key if ($highest < $value) ;
You're storing the key, and comparing the key to the value
But it sounds like you want to compare values, not keys
So you need to store $highest_key and $highest_value, and compare $highest_value to $value
In reply to Re: highest value in hash (key is not value)
by Anonymous Monk
in thread highest value in hash
by maciej
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |