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 | |
by listendohg (Novice) on Apr 09, 2016 at 17:55 UTC | |
by LanX (Saint) on Apr 09, 2016 at 17:59 UTC | |
by ww (Archbishop) on Apr 09, 2016 at 19:39 UTC |