# Open the file containing the matches to remove open(BADSHARES, "c:/testy/Bad_Shares.txt"); @BadShares = ; # Open the file/s to remove these matches from open(CURRENTDAT, "c:/testy/test.dat"); @DatLines = ; # For each line in the file to match from for ($a = 0; $a < scalar(@DatLines); $a++) { # Go through each line of the file to remove these matches from for ($i = 0; $i < scalar(@BadShares); $i++) { # If the current line in the DAT matches any line in the file to match set that line to zero # print "$DatLines[$a] $BadShares[$i]"; if ($DatLines[$a] =~ m/($BadShares[$i])/i) { print "MATCH $DatLines[$a] $BadShares[$i]"; # $DatLines[$a]="" } } }