You can do inplace editing from inside scripts with $^I, which is the equivalent for the -i command line option. It is described in perlvar.
In reply to Re^2: read from a file and write into the same file
by olus
in thread read from a file and write into the same file
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |