my $flipflop = 1; my @result = grep { $flipflop = not $flipflop; }, @input;