in reply to Re: Get even postion elements in an array
in thread Get even postion elements in an array

for completeness, an application of the new state feature for implicit initialization and scoping:

DB<23> use feature "state"; print grep { state $ff ^= 1 } 0..9 02468 DB<24> use feature "state"; print grep { not state $ff ^= 1 } 0..9 13579

Cheers Rolf