in reply to comparing two values under 'perl -w'

Interesting... Offhand, I can't think of anything, so I'd suggest:
sub equalOrBothNull { my ($a, $b) = @_; ((defined($a) && defined($b) && $a==$b) || (!defined($a) && !defined($b)); }
That way, you can at least hide the problem and make the main code more readable.

By the way, I'm pretty sure

not defined($a) && not defined($b)
is not what you want.
$ perl -MO=Deparse -e'not defined($a) && not defined($b)' not defined $a && !defined($b); -e syntax OK
Not doesn't bind as tightly as !.
--
Mike