in reply to Infinity loop
Well, that's because $_[0]->seq() continues to return strings that have "CG" in them. And it probably returns a new string each time, or a copy of a string (which would be new), and then the match tries again.
What you probably want is:
But I'm not sure about that. Are you trying to count the number of CG sequences? Then you want:my $seq = $_[0]->seq(); while ($seq =~ /CG/) { ++$CG }
I think that "+=()=" may be called the "pimply-goatse-operator". Not sure. Ignore that.$CG += () = $_[0]->seq() =~ /CG/g;
What is it that this code is really trying to accomplish?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Infinity loop
by doob (Pilgrim) on Nov 20, 2005 at 16:36 UTC | |
by nobull (Friar) on Nov 20, 2005 at 17:59 UTC | |
by thospel (Hermit) on Nov 20, 2005 at 22:03 UTC |