in reply to Re^2: 'xor' operator is not a sibling to 'or' and 'and'?
in thread 'xor' operator is not a sibling to 'or' and 'and'?
and and or return the last expression evaluated; xor always evaluates both sides and then returns the exclusive or of those two expressions (not either of the surrounding expressions) so it's always going to be a boolean value either 1 or ''/0. See perlop
Update: On further reflection I think I see what your expectations for the behavior might be based on and/or's behavior: if A xor B is true return whichever of A or B was true, otherwise return false.
The cake is a lie.
The cake is a lie.
The cake is a lie.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: 'xor' operator is not a sibling to 'or' and 'and'?
by rsFalse (Chaplain) on Dec 18, 2019 at 21:11 UTC | |
by Fletch (Bishop) on Dec 18, 2019 at 21:23 UTC | |
by rsFalse (Chaplain) on Dec 18, 2019 at 21:35 UTC | |
by pryrt (Abbot) on Dec 18, 2019 at 22:57 UTC | |
by rsFalse (Chaplain) on Dec 18, 2019 at 23:13 UTC | |
| |
by LanX (Saint) on Dec 21, 2019 at 19:31 UTC |