Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask

Re: Find most frequently used word in text file.

by toolic (Bishop)
on Dec 19, 2013 at 19:51 UTC ( #1067877=note: print w/replies, xml ) Need Help??

in reply to Find most frequently used word in text file.

I think there is a bug. You sort lexically, not numerically. Try this instead:
@values = sort { $a <=> $b } @values;

Tip #1 from the Basic debugging checklist: use strict and warnings. strict generates a compile error, and warnings generates these (and more):

Scalar value @values[-1] better written as $values[-1] Name "main::file" used only once: possible typo

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1067877]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (6)
As of 2017-03-28 20:29 GMT
Find Nodes?
    Voting Booth?
    Should Pluto Get Its Planethood Back?

    Results (341 votes). Check out past polls.