Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: How to get the correct count

by Ratazong (Prior)
on Apr 19, 2012 at 10:59 UTC ( #965911=note: print w/ replies, xml ) Need Help??


in reply to How to get the correct count

while($k=~ /[AG]TG.*T[AG][AG]/ig){$GENE++}
This is probably not doing what you expect, because the quantifier * is greedy. You might change it to
while($k=~ /([AG]TG.*T[AG][AG])/ig){$GENE++; print "$1\n";}
to see what happens. (The new code stores the matching part (using () ) to the special variable $1 and prints it).

HTH, Rata


Comment on Re: How to get the correct count
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://965911]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (6)
As of 2015-08-01 03:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (285 votes), past polls