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!