in reply to find and replace

Just for completeness, here's an example of one of the approaches that ambrus already mentioned:

{ local $^I = ''; local @ARGV = 'c:/index.htm'; while ( <> ) { s/foo/bar/g; print; } }
I think that Tie::File rocks, but it's more firepower than the problem requires, I think.

Also, why the /m in your s///, when there is no ^ or $ in the regex? Likewise, why the /s when there is no . in the regex?

the lowliest monk