Front page | perl.perl6.language |
Postings from September 2002
Re: Regex query
From:
Aaron Sherman
Date:
September 24, 2002 02:21
Subject:
Re: Regex query
Message ID:
1032859297.15470.166.camel@localhost.localdomain
On Tue, 2002-09-24 at 01:46, Trey Harris wrote:
> In a message dated 24 Sep 2002, Aaron Sherman writes:
> > This is because push is
> > almost certainly defined as:
> >
> > sub push(@target, *@list) { ... }
>
> That should be
>
> sub push(@target is rw, *@list);
Well, yes, but that wasn't the point. The C<*@list> will force array
flattening, thus
push @a, [1,2,3], 4;
will (according to Larry's stated desire to unify arrays and references
to arrays in terms of behavior) result in four elements getting pushed
onto C<@a>, not two.
Therein lies the rub.
--
Aaron Sherman <ajs@ajs.com>