See. the File::Transaction docs for more info.use File::Transaction; my $ft = File::Transaction->new; $ft->linewise_rewrite($fname); ## do stuff if($file_contents_changed) { $ft->commit } else { $ft->revert }
_________
broquaint
In reply to Re: Re-runnably editing a file in place
by broquaint
in thread Re-runnably editing a file in place
by eyepopslikeamosquito
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |