in reply to Re: count sort & output
in thread count sort & output
A less verbose way to do something similar:
my $data = do { local $/; <DATA> }; my $patt = join '|' => map quotemeta, 'a' .. 'z'; my %freq; $freq{$1}++ while $data =~ /($patt)/go; # etc...
Of course, counting occurrences of mere letters should normally be done using tr. ;-)
Also, mkent may want to save intermediate (sorted) results to avoid duplicating work.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: count sort & output
by sauoq (Abbot) on Dec 19, 2002 at 17:20 UTC | |
by Anonymous Monk on Dec 19, 2002 at 22:21 UTC |