http://qs321.pair.com?node_id=156027

kappa has asked for the wisdom of the Perl Monks concerning the following question:

The task is to compare two variables in such a way that if they are both undef, then they should be treated as equal.

($a == $b) gives me warning about using undefined values.
(defined($a) && defined($b) && $a == $b) is wrong
((defined($a) && defined($b) && $a == $b) || (not defined($a) && not defined($b))
is ugly.

This is used to detect changes in a database. This leads to the requirement that NULL must be equal NULL (which isn't right in the general case of course).