If it's the latter you want:
map { $_ & 1 ? $_ : () } @l;
--- On Wed, 5/16/12, damien krotkine <dkro...@gmail.com> wrote:
@list[ grep !$_%2, 0..$#list ];
that gets you every other element, beginning with the first.
--- On Wed, 5/16/12, John Douglas Porter <johnd...@yahoo.com> wrote:
> From: Aristotle Pagaltzis <paga...@gmx.de>
> Subject: Re: seeking golfing advice
> To: f...@perl.org
> Date: Friday, May 18, 2012, 5:29 AM
D::oh is right. You get an unwanted extra undef at the end of such list.