You can use the combination of
-p and
-i command line parameters to make Perl edit files in-place (like
sed does). Actually, it does this by renaming the input file, opening the output file by the original name, and selecting that output file as the default for print() statements (a quote from
perlrun).
Sorry if my advice was wrong.