use 5.010; my @a = (1, 3, 5); my @b = qw/ 0 x 2 x 4 x 6 7 8 9 /; print @b[grep { not $_ ~~ @a } 0 .. $#b]; __END__ 0246789