agynr has asked for the wisdom of the Perl Monks concerning the following question:
How can I find out the no. of occurences of the string in the data without going into the while loop. Please get a way out!!!!$pattern = (reement\s*PFPC\s*receives\s*fees\s*at\s*annual\s*rate\s*of +\s*)(#.{0,3}#)(\s*\s*of\s*average\s*net\s*asset\s*value\s*of\s*outsta +nding\s*In\s*) while ($data =~m/$pattern/gi) { $counter_number_of_search+=1; } if ($counter_number_of_search == 1) { ##### Do some operation ######## } else { ####### increase the margin to search ##### }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Searching no. of times the pattern occurs in the data
by prasadbabu (Prior) on Feb 12, 2005 at 05:22 UTC | |
by Roy Johnson (Monsignor) on Feb 12, 2005 at 15:04 UTC |