http://www.perlmonks.org?node_id=1018587


in reply to Perl beginnere

Some useful starting information:
  1. Files and I/O in perlintro talks about how to open and read a file.
  2. You need to define what you mean by a 'word'. I know that sounds a bit strange at first, but that will control how you split your sentences up.
  3. length and split will probably be very useful functions, though you may use other variants on regular expressions for the line parsing.
  4. For all word counts, you'll definitely want to use a hash.

Post code that you've written, and we'll be happy to give both syntactic and stylistic feedback. However, we're here to help you learn, and learning generally takes a lot of work on your part. See How do I post a question effectively?.


#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.