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


in reply to Modify values of tied, split lines in a file

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.