open(LOG, "$file"); while () { chomp($_); (@data) = split(/\t/, $_); (@zip) = split(//, $data[0]); $string = ""; for ($i=0; $i<=4; $i++) { # $string .= "$zip[$i]"; $string .= "substr($data[0], 7, 500)"; } # # match 1st 5 with the zip file # if ($z eq $string) { print NEW "$_\n"; } } close(LOG);