Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Propagaing error from deeply nested calles

by jdporter (Paladin)
on Nov 24, 2019 at 03:15 UTC ( [id://11109138]=note: print w/replies, xml ) Need Help??


in reply to Propagaing error from deeply nested calles

So you're asking how to do exceptions in Perl? This is done with the eval and die keywords, which are roughly analogous to catch and throw, respectively.

You can learn about it in this section of the Modern Perl book.

There's a discussion of the underlying implementation (which does in fact use longjumps) in this section of the perlinterp document.

And finally (lol) ... If you want true try/catch syntax, the best choice may be (according to a little search I just did) one of the following modules: Try, Syntax::Feature::Try, and Syntax::Keyword::Try.

I reckon we are the only monastery ever to have a dungeon stuffed with 16,000 zombies.
  • Comment on Re: Propagaing error from deeply nested calles

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (8)
As of 2024-04-23 17:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found