Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

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

by choroba (Cardinal)
on Oct 19, 2013 at 22:01 UTC ( [id://1058959]=note: print w/replies, xml ) Need Help??


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

Very similar to a recent question. See Re: Trying to compare a string....

Update: In your case, regular expression would be the easiest solution:

my $dna = shift; # Get the first command line argument. if ($dna =~ /[^ACTG]/g) { die "Non-nucleotide at " . pos($dna); }
لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ
  • Comment on Re: If/else within a foreach loop to check strings within an array
  • Download Code

Replies are listed 'Best First'.
Re^2: If/else within a foreach loop to check strings within an array
by Anonymous Monk on Oct 19, 2013 at 22:05 UTC

    Fantastic, thank you!

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (7)
As of 2024-04-23 13:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found