http://www.perlmonks.org?node_id=1019926


in reply to Re^2: "undef" is not NULL and what to do about it
in thread "undef" is not NULL and what to do about it

we probably hit code like this

Assuming that probably things are going to happen always is a recipe for disaster.

Your implementation of decrease_salary seems plausible, but it is not the only one. In order to ensure that you are handling "unknown" values right you will be forced to examine it, and even then, this is not perfectly safe, because somebody may rewrite that function in the future without noticing that subtle dependency.

IMO, the only unknown value that makes sense is one that croaks when used as part of any operation (including comparisons) and that has to be explicitly checked with is_unknown.

Or you can just use...

use warnings FATAL => 'uninitialized';

though, this will not cross lexical scopes, so I can still see value on having a magic unknown value.