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


in reply to Re^2: How come undef eq '' ??
in thread How come undef eq '' ??

I subscribe to this opinion as well.

To me, undef could mean a couple of things, depending on context:

What all of these reasons have in common, is that they essentially mean to represent mu.

If asked the question, "did you stop beating your wife?" then the answer "no" would imply that you still beat your wife. "Yes" doesn't cut it either, because it directly means that you used to beat her. But "mu" or "undef" would mean, "the question does not apply, I have never beaten her."

Therefore, I think that if you're about to do something with a variable (print it, interpolate it, do arithmetic operations with it, throw it against a wall, feed it to your dog), you should either make sure it isn't undef, or explicitly check for its definedness.