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

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()


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.


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

Replies are listed 'Best First'.
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).


      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?

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://810204]
[shmem]: welcome back, canary!

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (5)
As of 2018-02-21 21:43 GMT
Find Nodes?
    Voting Booth?
    When it is dark outside I am happiest to see ...

    Results (288 votes). Check out past polls.