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); #### for (my $i = 0; $i <= 10; $i++){ print "Found $arrList[$i]" if (grep {$_ eq $arrList[$i]} @list_match) ## assuming that @arrList is an array of column 3 elements } #### grep {/$arrList[2]/} @list_match ## if I am searching for $arrList[2]