my %pairs; local $/; my $data = <DATA>; my @words = split /\W+/, lc($data_; $pairs{ $words[$_].' '.$words[$_+1] }++ for 0..$#words-1; print "$pairs{$_}\t$_\n" for sort { $pairs{$b}<=>$pairs{$a} } keys %pairs; __DATA__ To be or not to be, that is the question Ask not what your country can do for you but what you can do for your +country I think therefore I am I drink therefore I am I'm drunk therfore I was Alas twas not to be
In reply to Re: Dividing a file into groups of two words and counting them
by Anonymous Monk
in thread Dividing a file into groups of two words and counting them
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |