Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Changing the contents of a file

by l3v3l (Monk)
on Feb 02, 2006 at 23:16 UTC ( [id://527493]=note: print w/replies, xml ) Need Help??


in reply to Changing the contents of a file

Since what you are substituting always occurs at the end of a line, the easiest way to do this seems to me to be something like:
perl -pi -e 's/turkey$/fox/' file_full_of_turkeys_that_you_want_to_be_ +foxes

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2024-04-16 18:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found