The stupid question is the question not asked | |
PerlMonks |
Re: Counting words..by mulander (Monk) |
on Oct 24, 2005 at 15:08 UTC ( [id://502483]=note: print w/replies, xml ) | Need Help?? |
Here is one way to do it:
The /g modifier tells the regex to search for more matches if possible, and for each match the while loop's code block is executed ( $count++ in this case ). So this oneliner will tell you how many times it saw a 'seek' in a file.
In Section
Seekers of Perl Wisdom
|
|