Re: goto return ?




What about doing this?

return if do_one_then_two($whatever);
...
sub do_one_then_two {
my $what = $_[0];
if ($what) {
one();
two();
return 1;
}
return 0;
}

Thanks, I'm not looking for how to handle a condition necessarily.

I want to be able to:

log_error_and_return($error, @return) if $whatever;

instead of

if($whatever) {
log_error();
carp $error;
return @return;
}

basically I want to override return to log and carp first, every time its called.
.



Relevant Pages