in reply to Sorting Hash of Arrays by a Value
Updated 3.19.02 with comments.my @keys = sort { @{$info{$b}}[$index] <=> @{$info{$a}}[$index] #compare plain +numeric values || length($b) <=> length($a) #if there are matching vals comapre +key length || $a cmp $b #compare chr if ya gotta } keys %info;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Strange looking comparison block
by RMGir (Prior) on Mar 19, 2002 at 15:57 UTC |