Here you go,
(assuming numeric comparison is appropriate) [ Nope, alpha sort is correct, use cmp instead of <=>. I don't know how I missed that part of the question. ]my @sorted_keys = sort { $foo{$a}[1] <=> $foo{$b}[1] } keys %foo;
After Compline,
Zaxo
In reply to Re: sorting hash by value when value is an array ref
by Zaxo
in thread sorting hash by value when value is an array ref
by beachguy82
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |