foreach my $make (@make) { foreach my $car(@car) { if ($make =~ /$car/) { push (@shop, $make); print cftr2dmatch2 "@shop"; } } }