in reply to Re: Re: Returning two arrays..
in thread Returning two arrays..
and@all = (\@foo, \@bar); return @all;
are identical so far as perl is concerned. Kind of likereturn \@foo, \@bar;
print (1, 2, 3, 4); # and print 1, 2, 3, 4;
Anyway my suggestion is that if you're expecting a set number of elements from a subroutine then you can do something like this:
Note that if a subroutine returns a list and you do something like:my ($aryref1, $aryref2) = subroutine(); # or if you want the longer way. my $aryref1; my $aryref2; ($aryref1, $aryref2) = subroutine();
Then $ret will be the number of elements in the list that subroutine returned, not the first.my $ret = subroutine();
Jacinta
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Re: Returning two arrays..
by mr_mischief (Monsignor) on Jan 04, 2002 at 21:26 UTC |