in reply to Temporary files and cleaning up after an interruption

/me thinks
You may want an END block along these general lines.

END { system('\bin\mv',TEMPFILENAME,FILENAME) }

I'm not sure what type on interruption you are talking about or which ones will run the END block, but it may solve the problem.