my %hash = (foo => [1..2], bar => [1..3], baz => [1]); my @keys = sort { @{$hash{$a}} <=> @{$hash{$b}} } keys %hash; print "$_ - @{$hash{$_}}", $/ for @keys; __output__ baz - 1 foo - 1 2 bar - 1 2 3
_________
broquaint
In reply to Re: Sort Hash by Size of the Arrays it References
by broquaint
in thread Sort Hash by Size of the Arrays it References
by arunhorne
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |