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

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

by Bloodnok (Vicar)
on Sep 30, 2009 at 11:36 UTC ( #798297=note: print w/ replies, xml ) Need Help??


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

...or even, assuming ...second line... to be a specific requirement (c/w a statement of the loaction of the string to be changed):

perl -ni.bak -e 's/first/last/g if $. == 2; print' one.txt
A user level that continues to overstate my experience :-))


Comment on Re^2: How to modify words in a line using perl oneliner
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://798297]
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: (11)
As of 2015-07-06 17:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (80 votes), past polls