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

Re: Is there a way to catch an error within a module?

by rir (Vicar)
on Mar 17, 2008 at 18:45 UTC ( [id://674626]=note: print w/replies, xml ) Need Help??


in reply to Is there a way to catch an error within a module?

Judging by the info given in this thread, looks like an buffer overflow bug in File::Find. Appending "/.." when it should not.

Catching errors in Perl is done with the block form of eval. Something like:

eval { code_that_dies; } if ( $@ ne '' ) { code_to_recover_from_code_that_dies; }
There are modules to sugar the syntax; search for "error" and "exception" on CPAN.

Be well,
rir

Replies are listed 'Best First'.
Re^2: Is there a way to catch an error within a module?
by Anonymous Monk on Mar 23, 2008 at 09:27 UTC
    This is not buffer overflow

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (4)
As of 2024-04-25 23:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found