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


in reply to Rewriting into file

You can also use the -i command-line switch to modify a file in place. See perlrun for details.

(Well it's cheating a little bit, you would still use a temporary file but Perl takes care of the details.)

Cheers

dHarry