C:\>type convert.pl #!/usr/bin/perl -w -i.bak use strict; while (<>) { s/this/that/g; print; } C:\>type this.txt this this this this C:\>perl convert.pl this.txt C:\>type this.txt that that that that C:\>type this.txt.bak this this this this C:\>