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

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

I'm trying to replace all instances of img src="image.gif" with img src="/Images/image.gif" in about 100 HTML documents.   Below is what I've come up with, which creates the .bak file properly, but leaves a zero-byte edited file.   What am I overlooking?

perl -i.bak -n -e 's/img src=\"image\.gif\"/img src=\"\/Images\/image\.gif\"/g' file.html

    cheers,
    Don
    striving for Perl Adept
    (it's pronounced "why-bick")