Fist, I donβt understand that this is related to Perl, since you are using wget to load dowloading ... You can use libwww-perl (perldoc LWP) and have more control over the loading process.
Then I will force your idea of ββloading into the "tmp" file name and move the file successfully.
However, I think you need to go further and check the integrity of the files. Executing an MD5 or SHA hash is very simple and matches the loaded what you expect. You may have a short file on the server containing the checksum (filename.md5). Define success only when you have a match.
Please note that the capture of all signals and, as a rule, an attempt to make the process unsatisfactory, and then expect that it will work, at some point, will work. There may be a network timeout, a power failure, a power failure, a configuration problem on the server ... you must assume that the download may fail because they will, and the code so that your process can recover.
Finally, you do not tell us which binary files you download and what you do with them. Since you are using wget, I am going to assume that you are working on Unix; you should consider using RPM + Yum or the like, they will handle all this for you. RPM is easy to write, really.
niXar source share