Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I'm trying to get it to print in order according to the value of sorter_total as follows:$hash{me}{sorter_total}=10; $hash{john}{sorter_total}=30; $hash{landon}{sorter_total}=20; $hash{jimmy}{sorter_total}=40; foreach my $user ($hash) { @sorted = (sort {$b <=> $a} keys %{$hash{$user}{sorter_total}}); } foreach (@sorted) { print "$_\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Sorting Problem
by atcroft (Abbot) on Mar 11, 2005 at 21:15 UTC | |
|
Re: Sorting Problem
by Anonymous Monk on Mar 11, 2005 at 21:18 UTC | |
by QM (Parson) on Mar 14, 2005 at 00:01 UTC |