for my $pat (@array1) { push @a3, grep { index($_,$pat) > -1 } @array2; }