use strict; use warnings; my %hash = ( 23=> "er",3.5 =>"rt", 56=>"ssd",7=>"ert"); print "$_:-:$hash{$_}\n" for sort {$b <=> $a} keys %hash;
To learn more about sorting go through following site
In reply to Re: sorting a hash
by ashokpj
in thread sorting a hash
by Lhamo_rin
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |