Just for completeness, here's an example of one of the approaches that ambrus already mentioned:
I think that Tie::File rocks, but it's more firepower than the problem requires, I think.{ local $^I = ''; local @ARGV = 'c:/index.htm'; while ( <> ) { s/foo/bar/g; print; } }
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
In reply to Re: find and replace
by tlm
in thread find and replace
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |