Re: goto return ?
- From: tom@xxxxxxxxxxx (Tom Allison)
- Date: Tue, 28 Nov 2006 03:22:48 -0500
Rob Dixon wrote:
JupiterHost.Net wrote:
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.
I would make do with
log_error($error), return(@return) if $whatever;
(log_error($error) && return(@return)) if $whatever:
This will work but if log_error ever fails then it will not execute return(@return). perhaps I don't understand your code.
.
- References:
- goto return ?
- From: JupiterHost.Net
- Re: goto return ?
- From: Tom Phoenix
- Re: goto return ?
- From: JupiterHost.Net
- Re: goto return ?
- From: Mumia W.
- Re: goto return ?
- From: JupiterHost.Net
- Re: goto return ?
- From: Rob Dixon
- goto return ?
- Prev by Date: Perl Query - Conversion of EXE file
- Next by Date: What's this string?
- Previous by thread: Re: goto return ?
- Next by thread: Re: goto return ?
- Index(es):
Relevant Pages
|