#!/usr/bin/perl while (<>){ s/CAT/mouse/g; print; } #### prompt> perl -w myscript.pl 'D:\tmp\file.txt' > D:\tmp\file.txt