Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
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 browsing the Monastery: (6)
As of 2015-04-19 10:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Who makes your decisions?







    Results (358 votes), past polls