|Perl Monk, Perl Meditation|
Correct code for deleting old file?by markuswinter (Novice)
|on Jun 15, 2012 at 09:29 UTC||Need Help??|
markuswinter has asked for the
wisdom of the Perl Monks concerning the following question:
sorry, total newbie question:
We have a script which gets an array of URLs (@taxonomy_file_url) and downloads the new files:
However there is a problem: the script does not delete the old file first, so the newly downloaded file becomes taxonomyFile1, then taxonomyFile2, then taxonomyFile3 etc etc
As the main app ONLY looks for taxonomyFile it will never see the new file.
So I want to delete the old file (if it exists):
Is this the correct way of doing it?
Thanks for any advice you have!