in reply to forgetting the simple stuff?
The standard way of doing this is indeed to open a file with a different name, and then move it back over the old one when you have finished (assuming you consider that all has gone well). You can get perl to handle this automatically with the -i switch, otherwise, you can do it yourself.
Another simple thing you are forgetting to do is not checking whether your opens are working correctly, or failing silently. Check the results of the $! variable.
|
|---|