Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: Re: Word Counting

by samurai (Monk)
on Apr 24, 2003 at 21:02 UTC ( [id://253004]=note: print w/replies, xml ) Need Help??


in reply to Re: Word Counting
in thread Word Counting

I would reccomend $wordhash{lc $word}++; as opposed to $wordhash{$word}++; if you're not worried about case-sensitivity, so you don't end up with:

To: 50
to: 23

Also, if you're going to split on \s+ as everyone seems to be suggesting, don't forget you're going to have to $word =~ s/\W//g to get rid of those unsightly punctuation marks.

--
perl: code of the samurai

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (2)
As of 2024-04-25 21:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found