in reply to Re: This is why Perl is so frustrating
in thread This is why Perl is so frustrating

Namely: For a given A != B, (!A or !B) == !(A && B), which will always be true for any single value.

ow.

You attached two conditions to (!A or !B) == !(A && B), but it's always true.

You refer some non-existent "single value" because you meant to talk about (V != A) or (V != B).


I believe you meant:

(A or B)
is equivalent to
!(!A and !B)
Because of that,
(V != A) or (V != B)
is equivalent to
!( (V == A) and (V == B) )

If A != B, the "and" is obviously false (since V can't have two different values at the same time), and the whole statement is therefore true.

Replies are listed 'Best First'.
Re^3: This is why Perl is so frustrating
by jrsimmon (Hermit) on Jul 30, 2009 at 01:06 UTC
    Yeah, I changed which side of the statement I was adding the A != B qualifier, didn't clean it up well. Thanks for clarifying it.