I'm sure this has been covered billion times:
Until recently, I assumed that the binary operator "||" functions as
either-or. Now I read that it evaluates the left side and, if it evaluates
true, doesn't care about the right. So if I want to test whether either
$one or $two exists, || would be a bad choice:
my $one = "some";
my $two = "stuff";
if ($one||$two) { print "yes\n";}
else { print "no\n";}
The if-condition would evaluate as true also if both values exist, which I
don't want.
My understanding is that either-or (i.e. excluxive or) on strings would
best be done with "xor". Is that correct?
thanks,
Birgit Kellner
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]