And for some reason it counts a slightly different number of words! But not like one less or one more, it's not at all consistent!! WHY oh WHY will it not count the numbers of words correctly??? Can anyone help me? Am I doing something REALLY dumb?? Katy Mforeach $sentence(@sentences) { #print FILE "$sentence\n"; @words = split(/[^\w'a-zA-Z0-9_'-?]/,$sentence); $Counter =0; foreach $word(@words){ $Counter = $Counter+1; print ("$word\n"); } $sentence_count{($Counter)} = $sentence_count{($Counter)}+1; } while (($sentence_count,$word_count) = each(%sentence_count)) { print ("There are $word_count sentences of $sentence_count words\n +"); } <P>
In reply to Sentence Measurer by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |