perl script.pl infile > outfile perl -i.bak script.pl file # in-place