in reply to Replace a pattern in each file
The problem is that you're not doing the search correctly.
Mike
You wrote:
but the correct syntax is justs#<--/--a8300-->.*?<--/a8300-->.##isg $_;
without the trailing ' $_' - the syntax of s/// is actuallys#<--/--a8300-->.*?<--/a8300-->.##isg;
with the $string being acted on defaulting to $_. Putting $_ after the expression makes no sense to perl...$string=~s/from/to/opts;
Mike
In Section
Seekers of Perl Wisdom