Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

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?

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (5)
As of 2018-10-21 09:02 GMT
Find Nodes?
    Voting Booth?
    When I need money for a bigger acquisition, I usually ...

    Results (119 votes). Check out past polls.