Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Replace a pattern in each file

by RMGir (Prior)
on Nov 01, 2013 at 12:16 UTC ( [id://1060752]=note: print w/replies, xml ) Need Help??


in reply to Replace a pattern in each file

The problem is that you're not doing the search correctly.

You wrote:

s#<--/--a8300-->.*?<--/a8300-->.##isg $_;
but the correct syntax is just
s#<--/--a8300-->.*?<--/a8300-->.##isg;
without the trailing ' $_' - the syntax of s/// is actually
$string=~s/from/to/opts;
with the $string being acted on defaulting to $_. Putting $_ after the expression makes no sense to perl...

Mike

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1060752]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (6)
As of 2024-04-25 14:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found