You're mistaken as hashes are (by nature) unsorted. You may very well have a sorted list of keys in which case you can use a slice (my @first_five = @sorted_keys[0..4]).
The cake is a lie.
The cake is a lie.
The cake is a lie.
In reply to Re: how to print top 5 elements from a hash
by Fletch
in thread how to print top 5 elements from a hash
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |