Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: find & replace a string in perl

by davido (Cardinal)
on Nov 25, 2010 at 13:53 UTC ( #873642=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    perl -pi.bak -e "$_ = '# ' . $_ if /\btest\b/" filename.txt
    
  2. or download this
    use strict;
    use warnings;
    ...
    }
    
    untie @filelines or die $!;
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (5)
As of 2022-08-17 01:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?