in reply to Fetch every other item in a list

Also breaks on lists like ('foo', 'bar', 'foo', 'blat'). I'd suggest:
@even = @array[map 2*$_, 0..$#array/2]; @odd = @array[map 2*$_+1, 0..$#array/2];
You can obfuscate this if you wish...

$_="goto+F.print+chop;\n=yhpaj";F1:eval

Replies are listed 'Best First'.
RE: RE: Fetch every other item in a list
by extremely (Priest) on Oct 24, 2000 at 05:16 UTC
    Blew my last vote of the day on that post, japhy. =) I was coming back to post the basically same thing in an update to my post.

    --
    $you = new YOU;
    honk() if $you->love(perl)