in reply to Sorting data structure
But I get compile time errorsfor my $user ((sort { $users{$b}->{count} <=> $users{$a}->{count} } ke +ys %users) { blah blah... }
Is the problem obvious? Right now I'm being forced to sort to a list, then iterated over the items in the list:Global symbol "$user" requires explicit package name at
my @sorted_users = sort { $users{$b}->{count} <=> $users{$a}->{count} } keys %users; for (@sorted_users) { blah... blahh }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Sorting data structure
by davido (Cardinal) on Oct 14, 2005 at 15:33 UTC | |
by mhearse (Chaplain) on Oct 14, 2005 at 15:52 UTC | |
by 5mi11er (Deacon) on Oct 14, 2005 at 18:55 UTC |