A combination of open my $fh, '+<', ..., read, truncate $fh, 0; and seek $fh, 0, 0; (and then write) should do what you ask.
In reply to Re: Capture Contents AND Overwrite without Opening Twice?
by Anonymous Monk
in thread Capture Contents AND Overwrite without Opening Twice?
by mmartin
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |