Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Replace a pattern in each file

by RMGir (Prior)
on Nov 01, 2013 at 12:16 UTC ( #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
Node Status?
node history
Node Type: note [id://1060752]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (5)
As of 2017-12-15 09:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What programming language do you hate the most?




















    Results (423 votes). Check out past polls.

    Notices?