There are some advantages to working in-place over creating a temporary file:
This is pretty close to what the -i commandline switch does for Perl one liners
-i is closer to
open(my $fh_in, '<', $qfn); unlink($qfn); open(my $fh_out, '>', $qfn); ...
for now.
In reply to Re^3: Inserting a line in the middle of a text
by ikegami
in thread Inserting a line in the middle of a text
by goude
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |