Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: If/else within a foreach loop to check strings within an array

by drmrgd (Beadle)
on Oct 20, 2013 at 11:46 UTC ( #1059012=note: print w/ replies, xml ) Need Help??


in reply to If/else within a foreach loop to check strings within an array

It is possible to have more than non-standard nucleotide in your sequence? If so, you might consider looking for all the non-matches:

#!/usr/bin/perl use warnings; use strict; my $dna_input = shift; my @dna = split( '', $dna_input ); my (@index) = grep { $dna[$_] !~ /[ATCG]/ } 0..$#dna; print "Non-nucleotide at position $_\n" for @index;


Comment on Re: If/else within a foreach loop to check strings within an array
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (4)
As of 2015-07-04 21:26 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 (60 votes), past polls