http://www.perlmonks.org?node_id=502942


in reply to Re^5: One out of three ain't bad (order)
in thread One out of three ain't bad

In fact, the multiplication symbol (the middle-dot, ·) was reused for the "and" operator, and the addition symbol (+) was reused for the "or" operator, IIRC (which I may not recall correctly...).

You recall correctly. Some people find it counterintuitive that 'plus' (+) should be used for 'or' because, in natural language, we often use 'plus' as an informal conjunction meaning 'and'. But... it makes perfect sense when you compare the boolean algebra operators with their counterparts in arithmetic...

ABA and BA times B
0000
0100
1000
1111

ABA or BA plus B
0000
0111
1011
1112

So, addition is essentially boolean disjunction with the added feature of counting how many clauses are true. Having more than two values comes in handy. (Note that xor is the same as addition modulus 2.) The OP's query can be answered using only standard boolean algebra operators, of course. $x xor $y xor $z and not ($x and $y) would be one way.

-sauoq
"My two cents aren't worth a dime.";