Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

Re^3: compute the occurrence of words

by Utilitarian (Vicar)
on Feb 13, 2013 at 14:13 UTC ( #1018542=note: print w/replies, xml ) Need Help??

in reply to Re^2: compute the occurrence of words
in thread compute the occurrence of words

Perhaps I was unclear, one of the things you have to do in order to count the number of occurrences of each word in a given text is to create a list of the unique words present, the other thing you have to do is associate a count with each of these words.

If you can think of a data structure more suited to this purpose than an associative array or hash, I'd be very interested.

print "Good ",qw(night morning afternoon evening)[(localtime)[2]/6]," fellow monks."

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1018542]
[marto]: good morning all
[hippo]: Great slogan :)
[Corion]: Hi marto ;)
[mxb]: Hi all.
[Discipulus]: Hi marto
Discipulus mmh .oO(perl data chess.. 8 scalar, 2 arrays, 2 hashes, 2 refernses, 1 typeglob and atied scalar)

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (7)
As of 2018-03-19 09:26 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (236 votes). Check out past polls.