Path: utzoo!attcan!uunet!inpnms!logan From: logan@rockville.dg.com (James L. Logan) Newsgroups: comp.lang.perl Subject: Best way to nullify an intersection Message-ID: <601@inpnms.ROCKVILLE.DG.COM> Date: 3 Jul 90 03:32:43 GMT Organization: Data General Telecommunications, Rockville, MD Lines: 32 Is there a better or faster way to drop all elements in set B that intersect with set A? Here's what I've got so far: open(FILE1, "file1") || die; @A = ; close(FILE1) || die; open(FILE2, "file2") || die; @B = ; close(FILE2) || die; foreach $element (@A) { foreach (@B) { if (/^$element$/) { $_ = ''; last; } } } print @B; Also, how can I delete the element that was matched in @B, while also shortening the array by one element; rather than just setting the element to the null string? Thanks, -Jim -- James Logan UUCP: uunet!inpnms!logan Data General Telecommunications Inet: logan@rockville.dg.com 2098 Gaither Road Phone: (301) 590-3198 Rockville, MD 20850