Here is my filter: package F; use strict; use warnings; use Filter::Simple; FILTER { s/FOO/bar/g; # print qq(>>>\n$_<<<\n); # uncomment to see changed src }; #""; 1; Here's my sample program, filter commented out: #use F; use strict; use warnings; print "FOO is good\n"; while () { print; } __DATA__ Here is my FOO data. No FOO here. Run it, and I see this output: % perl U.pl FOO is good Here is my FOO data. No FOO here. Now, uncomment the "use F;", and I see this: % perl U.pl bar is good Here is my FOO data. No FOO here. Note that no text was changed in the DATA part. Now, uncomment the "" line in the filter, so my filter is now this: package F; use strict; use warnings; use Filter::Simple; FILTER { s/FOO/bar/g; # print qq(>>>\n$_<<<\n); # uncomment to see changed src } ""; 1; Rerun, and I get this: % perl U.pl bar is good