my $total_words = @words; #All word count my %count; $count{$_}++ for @words; # Here are the counts my $uniq_words = scalar keys %count; # Nš of uniq words # Print sorted by frequency print "$_\t$count{$_}" for (sort { $count{$b} <=> $count{$a} } keys %c +ount);
Hope it helps,
deibyz
In reply to Re: Frequency of words in text file and hashes
by deibyz
in thread Frequency of words in text file and hashes
by perl_seeker
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |