my @array = qw(dog cat cow horse donkey chicken); my @items = qw(cat donkey); # after the manipulation I'd like to have: @array == qw(dog cow horse chicken);