#! C:\Perl\bin\perl -w open (LIST, "List.txt" ); @mylist = (); open (FILE, "FILE.txt" ); @myfile = (); foreach $file(@myfile) { foreach $list(@mylist) { @temp = split (/\t/, $file); chomp @temp; if ( $temp[1] eq $list ) {print ("$file")} } }