in reply to Splicing and Sorting problem with Tie::IxHash
use warnings; use strict; my %hash = ( '1-1' => 80, '1-4' => 26, '4-4' => 3, '2-2' => 180, '2-4' => 72, '1-2' => 2196 ); my $count=1; foreach my $key (sort{$hash{$b}<=>$hash{$a}} keys %hash ) { print "$key : $hash{$key}\n" ; last if $count++ > 1; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Splicing and Sorting problem with Tie::IxHash
by monkfan (Curate) on Oct 06, 2004 at 07:57 UTC | |
by si_lence (Deacon) on Oct 06, 2004 at 10:10 UTC |