in reply to Re: interpretation of "neither...nor"

See DeMorgan's laws in formal logic. The solution is correct because (as truth tables will reveal),

! (defined $ENV{EDITOR} || defined $ENV{VISUAL})
is equivalent to,
(! defined $ENV{EDITOR} && ! defined $ENV{VISUAL})

After Compline,
Zaxo

Replies are listed 'Best First'.
Re^3: interpretation of "neither...nor"
by cgmd (Beadle) on Jun 17, 2007 at 15:50 UTC
    Thank you, Zaxo, for that reference.

    Following up, I have found:

    Augustus De Morgan originally observed that in classical propositional logic the following relationships hold:

    not (P and Q) = (not P) or (not Q)

    not (P or Q) = (not P) and (not Q)

    This explains why the following are equivalent instructions:

    print "no editor found\n" if ! (defined $ENV{EDITOR} || defined $ENV{VISUAL}); print "no editor found\n" if (!defined $ENV{EDITOR} && !defined $ENV{VISUAL});

    Thank you for setting me straight! This has been very helpful!