Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Find most frequently used word in text file.

by roboticus (Canon)
on Dec 19, 2013 at 19:44 UTC ( #1067874=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my ($bestVal, $bestKey) = (-1);
    foreach my $key (@keys) {
    ...
        }
    }
    print "The most frequent word in $ARGV[0] is $bestKey, which was seen 
    +$bestVal times.\n";
    
  2. or download this
    while (my $line = <FILE>) {
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1067874]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (6)
As of 2014-09-17 05:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (58 votes), past polls