Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
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 taking refuge in the Monastery: (7)
As of 2014-07-10 08:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

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








    Results (202 votes), past polls