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


in reply to "undef" is not NULL and what to do about it

I certainly would like to see good, clean semantics (in the context of Perl-5, which is actually here, as opposed to the maybe-someday Perl-6) that expresses at least the following two ideas:

undef, as “the value of this variable has not yet been defined,” indeed has been over-applied ... it has been stretched into service to cover all of these cases because the Perl language (AFAIK) offers nothing else.

What I do not know, of course, is what to do about it.   I do not delve into the world of perlguts.   But I endorse what you are saying here and would certainly like to find an improvement, operating within the context of Perl five.   (And, y’know, “if we can do Moose, we ought to be able to do this.”)

The fly in the ointment, of course, will be compatibility.   Any new ideas, no matter how great they may be, must somehow be introduced into the present.   That means, in particular, DBI, which currently uses undef to represent NULL ... this, indeed, being the best design-choice that has been available so-far.   As code begins to appear on the scene which supports these new semantics that both you and I apparently dream-of, it must be compatible somehow.   It must, “Just Work.™”