I have a script which uses File::Temp and File::Copy to create a temporary copy of a file to read from. The file in question is periodically rewritten by a Java process, and it's imperative that I get a complete version.
My concern is the conflicting warning regarding correct usage of the two modules.
Note that passing in files as handles instead of names may lead to loss of information on some operating systems; it is recommended that you use file names whenever possible.
And from File::Temp
For maximum security, endeavour always to avoid ever looking at, touching, or even imputing the existence of the filename. You do not know that that filename is connected to the same file as the handle you have, and attempts to check this can only trigger more race conditions. It's far more secure to use the filehandle alone and dispense with the filename altogether.
My question is; which of these warnings should take precedence? In this particular case, should I be using filehandles or names?
And more generally, how do you make judgement calls between conflicting usage warnings in situations like these?