in reply to Re: Re: Word Counting (contractions)
in thread Word Counting

I suspect a few people may be giving up in head-banging-on-the-desk frustration by now..., so I'll give it a shot. :)

You're so nearly there...you just need to replace a single line there with the line that perlplexer already gave you, which loops over the list from 'split' (using 'for' or 'foreach' - they're synonymous, so you use whichever one you think looks nicer - don't you love a language that takes aesthetics into account?) and increments the value in a corresponding 'words' hash. I'm not going to tell you though which line that is I'm afraid, 'cos methinks the student protesteth overmuch about this not being homework...I prescribe a healthy dose of Camel :)

Cheers,
Ben

  • Comment on Re: Re: Re: Word Counting (contractions)