Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Help with accepting inputs, wordcount, and print to a file

by toolic (Bishop)
on Sep 10, 2012 at 17:14 UTC ( #992810=note: print w/replies, xml ) Need Help??


in reply to Help with accepting inputs, wordcount, and print to a file

You could split your $line string on whitespace, then accumulate the results in a hash. The hash would store the counts of each word.

Look at perldoc -f print to see how to print to a file (or just redirect the output in your shell).

See also:

  • Comment on Re: Help with accepting inputs, wordcount, and print to a file

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://992810]
help
Chatterbox?
[Eily]: well, I didn't get the joke and I didn't get the image either because the proxy won't let me
[erix]: Leasure Suit L.
[LanX]: THEY are restricting your Internet?
[LanX]: join the fight brother
[Eily]: probably because I'm an underpriviledged millenial

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (9)
As of 2017-03-23 17:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (292 votes). Check out past polls.