Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

Re: "undef" is not NULL and what to do about it

by sundialsvc4 (Abbot)
on Feb 20, 2013 at 17:43 UTC ( #1019813=note: print w/replies, xml ) Need Help??

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:

  • NULL:   “it is known that there is the absence of a value.”
  • unknown:   “it is known that the value is unknown.”

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.™”

  • Comment on Re: "undef" is not NULL and what to do about it

Replies are listed 'Best First'.
Re^2: "undef" is not NULL and what to do about it
by herveus (Parson) on Feb 25, 2013 at 20:28 UTC

    NULL as used in relational databases still carries semantic ambiguity.

    It could indicate that the value is absent, or it could indicate that the value is unknown. Or it could mean either. If I recall correctly, Codd called for multiple flavors of NULL.


Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1019813]
[marioroy]: might need to backslash \'*.mp3\'
[marioroy]: It's a quoting issue inside qx. It's File::Find or qx. LA chooses qx. Almost there.
[marioroy]: Also \"%S\\\n\" oh my, not fun.
[Discipulus]: good night folks
[marioroy]: I will make a mp3info script that takes the -p "%S\n" args and test qx. I'm on the road, so will come back.
[marioroy]: All because File::Find is not fun for LA.
[marioroy]: good night Discipulus.
[Discipulus]: perl dreams to you all

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (11)
As of 2017-04-23 21:17 GMT
Find Nodes?
    Voting Booth?
    I'm a fool:

    Results (432 votes). Check out past polls.