Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: File::Util list_dir question

by holli (Monsignor)
on Nov 30, 2009 at 15:39 UTC ( #810204=note: print w/ replies, xml ) Need Help??


in reply to File::Util list_dir question

straight from the docs:

Flags accepted by new()

--fatals-as-status

Directive to instruct the new File::Util object that when any call to one of its methods results in a fatal error that it should return undef instead of the value(s) that would normally be returned by the call.
Don't take this as a RTFM please, it took me a while to find about that too.


holli

You can lead your users to water, but alas, you cannot drown them.


Comment on Re: File::Util list_dir question
Re^2: File::Util list_dir question
by Anonymous Monk on Nov 30, 2009 at 16:14 UTC

    Thanks very much holli.

    I passed right by it and should have been more attentive...but it is there so I'll call it a lowercase rtfm.

      No biggie. The interface of File::Util is non intuitive. Normally a method fatals (dies) or returns some kind of false on failure. File::Util does nothing of this.

      It uses a halb baked homegrown error handler that, believe it or not, calls exit on a 'fatal' error (like not being able to recurse into a directory).
      That's why you cannot trap it with eval nor with try{}catch{} (at least until said flag is specified).


      holli

      You can lead your users to water, but alas, you cannot drown them.
        "Half baked homegrown" ... what do you suggest should be different? To use die instead of exit?
        --
        Tommy

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (8)
As of 2014-12-18 23:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (69 votes), past polls