Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

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

by herveus (Parson)
on Sep 19, 2003 at 14:53 UTC ( #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? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (2)
As of 2022-05-27 22:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (98 votes). Check out past polls.

    Notices?