more useful options | |
PerlMonks |
Re^3: "undef" is not NULL and what to do about itby salva (Canon) |
on Feb 21, 2013 at 09:47 UTC ( [id://1019926]=note: print w/replies, xml ) | Need Help?? |
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...
though, this will not cross lexical scopes, so I can still see value on having a magic unknown value.
In Section
Meditations
|
|