use strict; use Quantum::Superpositions; my @a = qw(cat dog monkey); my @b = qw(cat dog); print map { $_ eq any(@b) ? () : ($_) } @a;