Why so complicated? ;)
my $count=0; $count += substr($dna, $_, 1) =~ /[CG]/ for map 3 * $_, 1 .. length($d +na)/3; print $count;
Examine what is said, not who speaks.
In reply to Re: Re^2: for loops
by BrowserUk
in thread Count every 3rd base occurence
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |