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

Re^12: Learning how to use the Error module by example

by adrianh (Chancellor)
on Jul 30, 2003 at 15:49 UTC ( #279219=note: print w/ replies, xml ) Need Help??


in reply to Re: Re^10: Learning how to use the Error module by example
in thread Learning how to use the Error module by example

The only thing that's "wrong" with return is that you have more than 2 return codes.

But why are multiple return statements "worse" than multiple throw statements? Why replace the boolean functionality found everywhere else in Perl with your own exception based mechanism? Why move mainline code into catch blocks?

I think we're just going to have to agree to disagree over this one! If I was a maintenance developer faced with the code you gave, or:

print $self->find($foo) ? "found" : "Not found"; if ( $@ ) { # Handle error here };

I know which I'd prefer :-)

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (8)
As of 2016-08-29 10:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    The best thing I ever won in a lottery was:















    Results (402 votes). Check out past polls.