You can sort the keys by value in the hash:
By comparing $b terms on the left, we get descending order.my @ips = sort { $ip{$b} <=> $ip{$a} } keys %ip; my @usrs = sort {$usr{$b} <=> $usr{$a}} keys %usr;
After Compline,
Zaxo
In reply to Re: Sorting hash values
by Zaxo
in thread Sorting hash values
by K_M_McMahon
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |