[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[SLUG] Re: Perl Q
On Wed, Jul 12, 2000 at 01:46:05PM +1000, Rick Welykochy wrote:
> 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.
apparently not. from perlref(1p):
Note that taking a reference to an enumerated list is
not the same as using square brackets--instead it's
the same as creating a list of references!
@nospam.list = (\$a, \@nospam.b, \%c);
@nospam.list = \($a, @nospam.b, %c); # same thing!
(i thought the same as you too)
oh, and of course:
As a special case, \(@nospam.foo) returns a list of
references to the contents of @nospam.foo, not a reference to
@nospam.foo itself. Likewise for %foo, except that the key
references are to copies (since the keys are just
strings rather than full-fledged scalars).
isn't perl wonderful ;)
--
- Gus
--
SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/
More Info: http://slug.org.au/lists/listinfo/slug