Peter Scott wrote:
On Sat, 23 Sep 2006 11:51:54 +0200, Andrej Kastrin wrote:
the script below count word occurences in input file. It uses simple
hash structure to store unique words and its frequencies.
[...]
foreach my $w (keys %words) {
print "$w|$words{$w}\n";
}
On Sat, 23 Sep 2006 11:51:54 +0200, Andrej Kastrin wrote:
> the script below count word occurences in input file. It uses simple
> hash structure to store unique words and its frequencies.
[...]
> foreach my $w (keys %words) {
> print "$w|$words{$w}\n";
> }
[...]
> Is that brainy solutio
Dear all,
the script below count word occurences in input file. It uses simple
hash structure to store unique words and its frequencies.
use strict;
my %words;
while (<>) {
chop;
foreach my $wd (split) {
$words{$wd}++;
}
}
foreach my $w (