Hi Khariton,
Yes you are right, for my previous node I just show how to get the maximum value in a hash. Now, I had updated the code, that will get the maximum value, as well as the corresponding keys.
# get values with numerical sort @values = sort {$a<=>$b} values %hash; # process each element foreach (keys %hash) { # get the key name of the maximum value print "\nkey : $_ : value $hash{$_}" if ($values[$#values] == $has +h{$_}); }
In reply to Re^4: max "value " of an hash
by k_manimuthu
in thread max "value " of an hash
by perl_user123
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |