Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Perl search and replace

by johngg (Canon)
on May 19, 2011 at 22:27 UTC ( [id://905824]=note: print w/replies, xml ) Need Help??


in reply to Perl search and replace

You could probably use a look-ahead and anchor the the beginning of the line.

perl -pi.BAK -e 's{^(?=Defaults\s+(?:env_reset|requiretty))}{#}'

I hope this is helpful.

Cheers,

JohnGG

Log In?
Username:
Password:

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

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

    No recent polls found