Re: goto return ?
- From: boyd <tbmoore9@xxxxxxxxxxx>
- Date: Fri, 24 Nov 2006 22:55:57 GMT
In article <45676C2D.3060707@xxxxxxxxxxxxxxx>,
mlists@xxxxxxxxxxxxxxx (JupiterHost.Net) wrote:
do_some_stuff_and_return( @stuff ) if $whatever;
# we got this far so keep on moving
The trick is I can't seem to goto() return in
do_some_stuff_and_return(), I'm sure since its so deep down...
Maybe you mean it to be like this:
@stuff = do_stuff_and_return();
where the subroutine contains:
return @an_array;
in it.
Or you can pass a reference like this:
my @stuff = ();
do_stuff_and_return(\@stuff);
and the subroutine would be something like:
sub do_...{
my $ref = shift;
# do stuff
$ref = \@my_array;
# no return statement needed.
}
Bottom line: the subroutine can alter the parameter list, or (better)
return an array.
Boyd
.
- References:
- goto return ?
- From: JupiterHost.Net
- goto return ?
- Prev by Date: Re: failed substitution
- Next by Date: Re: goto return ?
- Previous by thread: Re: goto return ?
- Next by thread: Re: goto return ?
- Index(es):
Relevant Pages
|