in reply to Keep getting "use of unitialized value" error in a weird place

Are you sure you want $aa-1 as the offset in your substr?

$ perl -Mstrict -Mwarnings -E ' my $str = q{abc} x 3; for ( my $idx = 0; $idx < length $str; $idx += 3 ) { my $three = substr $str, $idx - 1, 3; say $three; }' c cab cab $
$ perl -Mstrict -Mwarnings -E ' my $str = q{abc} x 3; for ( my $idx = 0; $idx < length $str; $idx += 3 ) { my $three = substr $str, $idx, 3; say $three; }' abc abc abc $

I know nothing of genetics so that might be what you want but it looks weird.

Cheers,

JohnGG

Replies are listed 'Best First'.
Re^2: Keep getting "use of unitialized value" error in a weird place
by LanX (Saint) on Apr 09, 2016 at 17:17 UTC
      this will take away the error, but then when i look at the output of the loop it's littered with stop codons. if i print $lol2 from within the loop, i get the amino acid sequences and they look good (stops always followed by M or some alternative start codon), but i still get this error.