#This will open the file that will contain the list of tables open(TABLES, '>tableUsed.txt') or die "The file tablesUsed.txt could not be writt en to\n"; #This will convert the files into lists to be searched @tableList=; @fileList=; @tableUsed=; #declarations $Y=0; $T=0; #This will search through the files and see if the tables exist in the file chomp @tableList; chomp @fileList; for $Y (@tableList){ for $T (@fileList){ if($T =~ /$Y/i){ print USED "$Y\n"; } } }#end of the for loop close(DOUT); close(TABLES); close(USED);