in reply to Searching no. of times the pattern occurs in the data
hi agynr, you can make use of undef $/;, and replace all the pattern using g.
I have used $& which will take lots of memory and the process will be slow.To avoid that you can assign to another variable and replace with empty string instead of $&.
undef $/; my ($count) = $data =~ s/((a\s*bcd\s*e)(f\s*ghi)(jkl\s*tr))/$&/gsi;
Prasad
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Searching no. of times the pattern occurs in the data
by Roy Johnson (Monsignor) on Feb 12, 2005 at 15:04 UTC |