Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

Re: Re: In time for Wimbledon

by dash2 (Hermit)
on Jul 01, 2003 at 22:00 UTC ( #270653=note: print w/replies, xml ) Need Help??

in reply to Re: In time for Wimbledon
in thread In time for Wimbledon

Yes, this is why I distinguished between lob and throw, and said:

The idea is that sometimes you definitely want to throw an error - there's no way to continue. On the other hand, you might just want to lob an error back to the caller, and let them decide if they want to go on.

In other words, if the subroutine throws an exception, you can't bounce it back. But if it lobs one, you can. Obviously, letting user code ignore serious errors would be foolish.

You could do it by argument-passing, just as you can do exception throwing by returning undef and letting the caller decide whether to die. But that doesn't mean exception-throwing isn't better. The advantage of this is that different calling code can decide to bounce different classes of exceptions. Just like try ... catch, it gives you more fine-grained control.
A massive flamewar beneath your chosen depth has not been shown here

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://270653]
[jedikaiti]: Hi Monks
[Eily]: Hello trahulprajapati don't hesitate to go straight to creating a new post in Seekers of Perl Wisdom when your question is complex
[jedikaiti]: Pretty!
[Eily]: the fact that you had to divide it into 4 points is a pretty good indicator :)
[Eily]: jedikaiti the intercommunicating life part is fun :)

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (10)
As of 2017-06-26 15:30 GMT
Find Nodes?
    Voting Booth?
    How many monitors do you use while coding?

    Results (583 votes). Check out past polls.