in reply to Re^3: if not defined
in thread if not defined

No need to use &&, as there is and. :)

Anyway, you've pinpointed the problem, it's a precedence problem, and

if(not foo and not bar) { ...
will do the right thing, as desired.