http://www.perlmonks.org?node_id=798297


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 :-))