in reply to If/else within a foreach loop to check strings within an array
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); }
|
|---|
| 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 |