local $^I = '.bak'; while (<>) { s/this/that/g; print; }