Every other

Damian Conway damian at conway.org
Fri Oct 30 21:52:43 GMT 2009


Nicholas Clark <nick at ccl4.org>:

>>     my @new = @old[0,2...*];
>
> That's a sequence of 0, 2, extrapolate?

Yep.


>>     my @new = @old[ 0...*+2, 6 ];
>
> Where's that's a sequence from 0 to whatever, with a stepping of 2?
> What is the 6 for?

Sorry, that's my brain spasming. The test code I was using had 6 elements. %-)

General form would be:

    my @new = @old[ 0...*+2, + at old ];

which means: "start at zero, increment by 2, stop at length of @old".

Damian



More information about the london.pm mailing list