[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
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 \(@nospam.a, @nospam.b);
The above will return a reference to the concatenated
array @nospam.a, @nospam.b ... not what you want.
> Ah. I had tried return (\@nospam.A, \@nospam.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 @nospam.a = @nospam.$a; # deref $a
my @nospam.b = @nospam.$b; # deref $b
Don't get confused by @nospam.a and $a - they are two completely
different and unrelated variables. Could have called them
@nospam.arraya and $a, or whataver.
--
Rick Welykochy || Praxis Services
--
SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/
More Info: http://slug.org.au/lists/listinfo/slug