in reply to sorting hash by value when value is an array ref
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: sorting hash by value when value is an array ref
by beachguy82 (Novice) on Nov 16, 2004 at 02:42 UTC | |
by ikegami (Patriarch) on Nov 16, 2004 at 07:24 UTC | |
|
Re^2: sorting hash by value when value is an array ref
by pg (Canon) on Nov 16, 2004 at 02:55 UTC |