$ perl -wE 'say grep {state $t ^= 1} qw[a b c d]' ac $