Don't ask to ask, just ask | |
PerlMonks |
Re: Best way to edit a file?by MonkE (Hermit) |
on Apr 02, 2007 at 13:03 UTC ( [id://607813]=note: print w/replies, xml ) | Need Help?? |
I recommend that you keep using your current approach (save as temp, delete original, and put temp in place of original). It's a very robust approach. It insures that you will always have a complete copy of the file, even if an error occurs during the save -- an error such as running out of disk space, etc. I would strongly caution against using any approach that destroys/overwrites/deletes the only copy of the file.
In Section
Seekers of Perl Wisdom
|
|