Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
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 examining the Monastery: (10)
As of 2016-08-30 14:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    The best thing I ever won in a lottery was:















    Results (418 votes). Check out past polls.