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

Thanks for that. Found another solution (from a colleague) which I have managed to implement. I've just created a few constants and changed the offending line as follows:

% cat t.pl #!/usr/bin/perl -w use strict; ... my $PIPE_STRING = q{| tail -n +2}; # starts from line 2 of input my $EMPTY_STRING = q{}; for my $chromosome ( sort { $a <=> $b } keys %chromosome_arms ) { if ( scalar @{ $chromosome_arms{$chromosome} } >= 2 ) { ... # a long running process (written in C++) my $format = qq{ask_bigdb [options] %s >> $filename\n}; # generate the command my $command = -e $filename # if file exists ? sprintf $format, $PIPE_STRING # use the tail pipe : sprintf $format, $EMPTY_STRING; # use the empty string # run the command here print $command; ... } }

Yes I do need a redo there. Otherwise I would not get the second arm of my chromosomes. And this solution also does not require me holding much in memory. (At least I think not!)

Thanks again.


Smoothie, smoothie, hundre prosent naturlig!