The
-i
option makes
<>
do "in-place editing," which creates a new file and automatically renames (if you supply a suffix) or causes to be removed (if you don't) the original file. For details, run
perldoc perlrun
or
man perlrun
or read
this page. If you use
perl -i
or
perl -i.orig
, then you don't need to redirect the output, and you shouldn't, as
perl
write the output file itself.