I think the truth table for "The ^ operator" is wrong. I think it should be:
Bit 0 | Bit 1 | Bit 0 ^ Bit 1
|
0 | 0 | 0
|
0 | 1 | 1
|
1 | 0 | 1
|
1 | 1 | 0
|
Also:
"&&" works by evaluating the right operand, and if and only if that returns a true value the left operand is evaluated and that result is returned. "||" works similar, but only evaluates the left operand if the right operand was false.
This is incorrect. Perl always works from left to right. See:
$a = 0;
$b = 0;
$c = $a++ && $b++; # only $a++ is evaluated
print "a = $a, b = $b\n"; # prints "a = 1, b = 0"
And:
$a = 0;
$b = 0;
$c = ++$a || ++$b; # only ++$a is evaluated
print "a = $a, b = $b\n"; # prints "a = 1, b = 0"
Otherwise I think this can go to Tutorials as well...
Liz