When you say "fails", do you mean "needs to return 0", or do you mean "throws an exception"? Because then this:
Might become:my $response = doSomething (); sub doSomething { #..do something which fails 0; }
my $response = doSomething (); sub doSomething { eval { #..do something which fails }; if ($@) { # handle the error } 0; }
In reply to Re: A question of style
by pbeckingham
in thread A question of style
by Scarborough
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |