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

you are getting precedence wrong, what you are effectively doing is ($base eq 'A') || 'T' || 'C' || 'G'

There are plenty of alternatives,like:

$base eq 'A' || $base eq 'T' || $base eq 'C' || $base eq 'G'

Cheers Rolf

( addicted to the Perl Programming Language)