while (defined( my $line = )) { chomp $line; my ($chr, $pos) = split(/\t/, $line); $chr += 0; # Numify. $pos += 1; # Make 1-based last if $pos >= $kgArr[1]; print OUTFILE "$chr\t$pos\n"; }