in reply to
Temporary text files with File::Temp
As a small aside, on Unix at least the use of Temp::File-generated temp files is inappropriate if you are using it for the purpose of atomic overwrite.
The reason is that most of the time /tmp is not on the same partition as the file you want to overwrite, so the resulting system move command to move the file into place is not atomic, it has to copy the bitstream.
If you want atomic overwrite, you HAVE to write the initial file to somewhere on the same partition as the target, which generally means to the same directory.