my $ctr=1; foreach $key (sort {$hash{$b} <=> $hash{$a}} keys %hash) { print "$key\t\t= $hash{$key}\n"; last if $ctr++ == 10; }