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


in reply to Search and replace within a file

Take a look at the -i switch, which does in-place file transformations.

Examples are in my presentation A Field Guide To The Perl Command Line.

xoxo,
Andy