Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Conflicting usage recommendations: File::Temp and File::Copy

by herveus (Prior)
on Sep 19, 2003 at 14:53 UTC ( [id://292667]=note: print w/replies, xml ) Need Help??


in reply to Conflicting usage recommendations: File::Temp and File::Copy

Howdy!

File::Temp is about the secure creation of temp files. It gives you back a file handle to the opened file and the file name. If you depend solely on the file name, you could get burned; the file handle points to the actual file File::Temp created.

With File::Copy, you are normally going to be referencing files by name, so converting the name to a file handle carries different hazards.

Consider the two warnings in the context of their respective modules. They are not contradictory unless you remove them from their contexts.

yours,
Michael

  • Comment on Re: Conflicting usage recommendations: File::Temp and File::Copy

Replies are listed 'Best First'.
Re: Re: Conflicting usage recommendations: File::Temp and File::Copy
by kilinrax (Deacon) on Sep 19, 2003 at 15:45 UTC
    I fear you misinterpret my use of the word 'contadictory'. The warnings are contradictory merely in the context of attempting to use the modules together in the way I describe; under such circumstances you cannot heed both.
      Howdy!

      True...given your particular usage, you can't slavishly heed both, but you can make a mature decision which warning is superfluous in your specific situation. (did I use enough big words? :))

      yours,
      Michael

        ... which was the decision I was looking for advice on :)

        Though there doesn't seem to be a total consensus as to which way to call this; in light of people's resopnses, my instincts are inclining towards the usage of filenames.

        In fact, I am beginning to wonder if relying on POSIX functions is A Good Thing. Perhaps File::Temp::PurePerl might be a good idea?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://292667]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (6)
As of 2024-04-24 09:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found