in reply to Skiping the first line of data/output stream

print qq{ask_bigdb [options] >> $filename\n}; ### OFFENDING LINE!!!

Suggestion:

my @lines = ask_bigdb(@options); # whatever that ask_bigdb is... shift @lines; # get rid of header open my $outfh, '>>', $filename # append to file or die "Can't append to '$filename': $!\n"; print $outfh @lines; close $outfh or die "Can't close '$filename': $!\n";
Then,
redo; # do the next arm of chromosome ...

here's a mismatch between code and comment. Are you sure you want redo her, and not next?

--shmem

_($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                              /\_¯/(q    /
----------------------------  \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}