#!perl! -w use strict; use Data::Dumper; my @A = ( 'yahoo.com', 'altavista.com', 'yahoo.com/index.html' ); my @B = ( 'yahoo.com', 'webcrawler.com' ); # The task: make a @C such that @C = ( 'altavista.com' ) # dragonchild's solution: my @C = map { my $x = $_; grep { $x =~ /\Q$_/i } @B } @A; # produces ( 'yahoo.com', 'yahoo.com' ) # proper solution: my @D = grep { my $x = $_; my @matches = grep { $x =~ /\Q$_/i } @B; ! @matches } @A; print Dumper [ \@A, \@B, \@C, \@D ];