On Feb 5, R. Joseph Newton said:

>my $sequence_length = 20;
>my $line = <DATA>;
>chomp $line;
>while ($line) {
>   my $sequence_tag = trim_line($line);
>   $line = <DATA>;
>   chomp $line;
>   my @nucleotides = split //, $line;
>   push @nucleotides, '_' for (1..($sequence_length - @nucleotides));

I'd be in favor of:

  push @nucleotides, ('_') x ($sequence_length - @nucleotides);

The 'x' operator on a list returns the list elements repeated the
specified number of times.

>__DATA__
> >bob
>AGTGATGCCGACG
>A G T G A T G C C G A C G _ _ _ _ _ _ _   bob

Ack.  You're mixing the input with the output!

-- 
Jeff "japhy" Pinyan      [EMAIL PROTECTED]      http://www.pobox.com/~japhy/
RPI Acacia brother #734   http://www.perlmonks.org/   http://www.cpan.org/
<stu> what does y/// stand for?  <tenderpuss> why, yansliterate of course.
[  I'm looking for programming work.  If you like my work, let me know.  ]


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to