Hi there, Very new to PERL (chapter 5 Learning PERL edition 2!!) but I am determined to master this!! Or at least be good at it!!
I'm having trouble grasping the code below. I know it's a small snippet but I think it's important. Can you please explain the $count variable and how the %count came about? chomp (@words = <STDIN>); # I understand this line as in you are reading in all the words foreach $word (@words){ # for every element of the array @words.......... $count {$word} = $count {$word} + 1; # or $count {$word}++ # I get a bit lost here!! Is $count the value of the key $word in a hash? } foreach $word (keys %count) {#How did %count come about? print "$word was seen $count {$word} times\n"; } Thanks again B ************************************************************************************************** The contents of this email and any attachments are confidential. It is intended for the named recipient(s) only. If you have received this email in error please notify the system manager or the sender immediately and do not disclose the contents to any one or make copies. ** eSafe scanned this email for viruses, vandals and malicious content ** ************************************************************************************************** -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]