Avoid rearranging the elements in an array you've just sorted.
Instead of reverse sort { $b <=> $a } keys %hash, write sort { $a <=> $b } keys %hash. The second approach reads more clearly and runs more quickly.
In reply to Re^2: printing largest hash value
by tomhukins
in thread printing largest hash value
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |