Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: stupid/simple mistake

by rnaeye (Pilgrim)
on Oct 18, 2011 at 17:02 UTC ( #932197=note: print w/ replies, xml ) Need Help??


in reply to stupid/simple mistake

This works for me:

my $substring = 'GATC'; my$i=0; my$count; my $sequence; while ($sequence=<DATA>){ foreach($sequence =~ /($substring)/g) { print "$1\n"; $count++; } } print "There are $count negative numbers in the string\n"; __DATA__ GAGAGACCCCGATCGAGAGACCCGATCFGAGAVCTGATCCCC


Comment on Re: stupid/simple mistake
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (15)
As of 2014-07-11 17:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (232 votes), past polls