rchou2 has asked for the wisdom of the Perl Monks concerning the following question:
and i print the output into a file which looks like this:foreach $name (sort keys by %x) { $a= $x{$name} ; $b= $y{$name} ; $total = $a/$b; print $name, $a, $b, $total }
right now i have my output sorted by x, but i want a descending sort using the values from total....how would i implement this by still using the foreach loop i have and getting the values printed out as before only sorted by descending values of total? thanks.$name $a $b $total abc 2 3 5 xyz 2 4 6
Update: Added <code> tags. larsen
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: help with sort by value
by DamnDirtyApe (Curate) on Jul 18, 2002 at 23:53 UTC | |
by rchou2 (Novice) on Jul 19, 2002 at 14:00 UTC | |
by DamnDirtyApe (Curate) on Jul 20, 2002 at 00:27 UTC | |
|
Re: help with sort by value
by Russ (Deacon) on Jul 18, 2002 at 22:59 UTC |