my $top = 10; my %cnt_hash; $cnt_hash{$_}++ foreach @srcs; foreach $key (sort {$cnt_hash{$b} <=> $cnt_hash{$a}} keys %cnt_hash) { print "$key\t$cnt_hash{$key}\n"; $i++; if ($i == $top){last;} }
In reply to Re^2: Top n Unique count from Array
by cipher
in thread Top n Unique count from Array
by cipher
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |