Lhamo_rin has asked for the wisdom of the Perl Monks concerning the following question:
This seems to be a simple question but one I have not found an answer for in the monastery.
I want to sort a hash from highest to lowest value.
For example:
%hash = ( 5.764 => a, 3.24 => b, 4.6 => c);
I would want this to print out as:
5.764 a
4.6 c
3.24 b
Thanks,
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: sorting a hash
by Samy_rio (Vicar) on Feb 28, 2006 at 12:51 UTC | |
by fishbot_v2 (Chaplain) on Feb 28, 2006 at 13:00 UTC | |
|
Re: sorting a hash
by mickeyn (Priest) on Feb 28, 2006 at 12:52 UTC | |
|
Re: sorting a hash
by Fletch (Bishop) on Feb 28, 2006 at 13:45 UTC | |
|
Re: sorting a hash
by ashokpj (Hermit) on Feb 28, 2006 at 14:50 UTC | |
|
Re: sorting a hash
by Jasper (Chaplain) on Feb 28, 2006 at 14:29 UTC |