in reply to Re: Lost in-place file edit code
in thread Lost in-place file edit code

Surprisingly I also had exactly the same deja vu type experience a couple of days ago. And as quoted above, the -p command loops through text executing the command you give, and printing the result. The -i specifies what extension you want to give to your backup files.

My most recent attempt was a file that looked like this:

#!/usr/bin/perl -i.orig -p s/submit_(.*?)_/submit\u$1/g;

I love the way you can specify command line arguments on the hash-bang line. The code above used the in-place capitalisation regexp operator discussed in another recent node (Regexp matched part to lower case).