http://www.perlmonks.org?node_id=279219


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 :-)