Tugger the SLUGger!SLUG Mailing List Archives

Re: [SLUG] Perl Q


On Wed, 12 Jul 2000, Michael Lake wrote:

> > Don't do that. In order to do what you want, you need to be using
> > array references.
> > return \(@a, @b);

The above will return a reference to the concatenated
array @a, @b ... not what you want.

> Ah. I had tried return (\@A, \@B); but got references back
> ie 	
> ARRAY(0x80d721c)1	ARRAY(0x80d7234)

The above is correct. You are simply missing the last step:
de-rereference the arrays:

my ($a,$b) = myfunction();
my @a = @$a;	# deref $a
my @b = @$b;	# deref $b

Don't get confused by @a and $a - they are two completely
different and unrelated variables. Could have called them
@arraya and $a, or whataver.


--
Rick Welykochy || Praxis Services