Beefy Boxes and Bandwidth Generously Provided by pair Networks vroom
Welcome to the Monastery
 
PerlMonks  

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

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

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://279219]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.