while ( ) { if (/fixedStep chrom=chrX start=(.+) step=1/) { $counter = $1; next; } print "$counter\t$_\n"; $counter++; close DNAFILE;