|
|
Subscribe / Log in / New account

Logical XOR

Logical XOR

Posted Jun 10, 2024 18:25 UTC (Mon) by rweikusat2 (subscriber, #117920)
In reply to: Logical XOR by pbonzini
Parent article: perl v5.40.0 released

a ^^ b is equivalent to (a || b) && !(a && b). In Perl, (a || b) && !(a && b) && (a == b) is possible:

perl -e '$a = 0; $b = 'abc'; print(($a || $b) && !($a && $b) && ($a == $b), "\n")'

:-)


to post comments


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds