On 2003-02-11 at 16:52:36, Dave Whipp wrote:
> "Mark J. Reed" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> >
> > On 2003-02-11 at 17:44:08, Mark J. Reed wrote:
> > >         pop @{[@a,@b,@c]}
> > >
> > > It creates an anonymous array, then removes the last element,
> > > leaving two elements in the array - which is irrelevant since
> > > the array is then discarded completely.
> > Minor correction: we don't know how many elements are left in the
> > array - it depends on how many elements were in @a, @b, and @c to
> > start with.  One less than that. :)
> 
> These days you need the splat operator to flatten lists: so the above starts
> out as a list of 3 array-refs, and the pop returns 1 array-ref, leaving 2 in
> the anon-array -- which then becomes garbage, to be collected sometime.
That may be true in Perl6, but my example was in Perl5 - to demonstrate
that the equivalent of [@a,@b,@c].pop currently works, despite the
previous poster's statement that it doesn't make sense.

But I didn't think it was true in Perl6 either - [@a,@b,@c] supplies
list context, so each of the arrays should be automatically flattened.

-- 
Mark REED                    | CNN Internet Technology
1 CNN Center Rm SW0831G      | [EMAIL PROTECTED]
Atlanta, GA 30348      USA   | +1 404 827 4754

Reply via email to