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
In reply to Re: Searching no. of times the pattern occurs in the data
by prasadbabu
in thread Searching no. of times the pattern occurs in the data
by agynr
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |