Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
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 making s'mores by the fire in the courtyard of the Monastery: (10)
As of 2016-07-01 11:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My preferred method of making French fries (chips) is in a ...











    Results (410 votes). Check out past polls.