in reply to Match string in array

Here's my try:

my @rray1=('one','red','orange','brown','green','blue','scarlett','fou +rteen'); my @rray2=('red','orange','yellow','green','blue','indigo','violet'); my @resul=grep { my $c=$_; grep /^$c$/, @rray1 } @rray2;

This searches in @rray1 every element in @rray2. So, what you want is simply the inverse:

my @resul=grep { my $c=$_; !grep /^$c$/, @rray1  } @rray2;

--
David Serrano