Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: How to modify words in a line using perl oneliner

by ccn (Vicar)
on Sep 30, 2009 at 10:20 UTC ( #798279=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    perl -i.bak -pe 's/first/last/g' one.txt 
    
  2. or download this
    perl -ni.bak -e 's/first/last/g; print' one.txt 
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://798279]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (8)
As of 2017-07-27 20:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I came, I saw, I ...
























    Results (422 votes). Check out past polls.