while (my $line =) { my (undef,undef,$three,$four,undef) = split "\t",$line; if ($three eq $checkthree) {print "$three found before $four in line $.\n"; last;} } close DATA;