Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Re: Re: error handling

by argggh (Monk)
on Jun 28, 2003 at 20:28 UTC ( [id://269927]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: error handling
in thread error handling

This is the mechanism used by Error.pm under the hood, more or less. While Error.pm is a much prettier interface than checking $@ yourself, it has some drawbacks. Since the arguments to both try and catch are anonymous subs, return will return from those and not from the enclosing sub, as you've experienced. You'll have to set up a variable with the value you want to return and then do so outside of try/catch.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (3)
As of 2024-04-19 19:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found