Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

Re: Propagaing error from deeply nested calles

by jdporter (Canon)
on Nov 24, 2019 at 03:15 UTC ( #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?

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (1)
As of 2021-12-07 03:52 GMT
Find Nodes?
    Voting Booth?
    R or B?

    Results (33 votes). Check out past polls.