in reply to Sorting a hash. What am I doing wrong?
is sorting the values stored in $seen{$a} against $seen{$b}, what you want is to sort the hash keys (not the hash values) then you want to just do something like the following:@uniq = sort {$seen{$a} <=> $seen{$b} } keys %seen;
@uniq = sort {$a <=> $b } keys %seen;
-enlil
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Sorting a hash. What am I doing wrong?
by mndoci (Scribe) on Jan 14, 2003 at 00:42 UTC |