my @list_match; my @matchArray; open IN, "Data.txt" or die $!; # The file here has one column while(){ chomp($_); push @list_match, $_; } close(IN); open INPUT, "Data_Large.txt" or die $!; # It is a tab delimited file having 7 columns. I am looking # to match the 3rd column words with the above # @list_match array while(){ chomp($_); my @arrList = split('\t', $_); print "Found $arrList[2]", if (grep {$_ eq $arrList[2]} @list_match) ## assuming it is a character } close(INPUT);