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

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Dear Monks,
I would like to modify the word "first" into "last" in the second line of file one.txt could you kindly help.

Input File(one.txt)
#verify_custom fleet part=first base=first after base

I tried the following perl one liner, but it did not help. perl -ni.bak -e 'print s/first/last/' one.txt
Expected Output: #verify_custom fleet part=last base=last after base
Thanks a lot.