chomp @tableList; chomp @fileList; for $W (@tableList) { for $Q (@fileList) { if($Q =~ /$W/i) { print USED "$W\n"; } } }