in reply to Re: for loops
in thread Count every 3rd base occurence
use strict; use warnings; my $string = "CTCCGGATCTAT"; my $counter = 0; $counter++ while $string =~ /..[GC]/gi; print "Found $counter occurences$/";
use strict; use warnings; my $string = "CTCCGGATCTAT"; my %flag = (C => 1, G => 1, A => 0, T => 0); my $counter = 0; $counter += $flag{$1} while $string =~ /..(.)/g; print "Found $counter occurences$/";
Makeshifts last the longest.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: for loops
by Aristotle (Chancellor) on Dec 17, 2002 at 00:05 UTC | |
by BrowserUk (Patriarch) on Dec 17, 2002 at 00:47 UTC | |
|
Re: Re^2: for loops
by BrowserUk (Patriarch) on Dec 16, 2002 at 22:08 UTC | |
|
Re^3: for loops
by Mr. Muskrat (Canon) on Dec 16, 2002 at 21:58 UTC |