Actually you already have an and/or operator (or).  The English
equivilent for "or" in perl is "xor". Examine:

Take this or that (NB this implies you cannot take both, but you must
take one).

take table (instead of truth table)
left left = not allowed (false)
left took = allowed (true)
took left = allowed (true)
took took = not allowed (false)

Compare this with xor's truth table:

false false = false
false true  = true
true  false = true
true  true  = false

Take this and/or that (NB this implies you can take one or both but you
must take one).

take table
left left = not allowed (false)
left took = allowed (true)
took left = allowed (true)
took took = allowed (true)

Compare this with or's truth table:

false false = false
false true  = true
true  false = true
true  true  = true

On 07 Jun 2001 18:39:32 -0400, Travis Smith wrote:
> <snip src="Chas Owens">
> Either you or I (or maybe both us) have a really dirty mind.
> <snip>
> 
> Isn't that like:
>   (true != 0)
> 
> You know, there's no and/or operator. In ksh you do have the |& - but that's
> something different.
> 
> Completely useless, but I want a and/or operator.
> 
> ~Travis Smith
> Systems Admin
> finger sage at post891 dot org
> for pgp public key
> tazium at yahoo dot com
> 
> "Please remember, life is not life without a death to embrace at the end."
--
Today is Pungenday, the 12nd day of Confusion in the YOLD 3167
Frink!


Reply via email to