in reply to Re: difference b/w undef and empty string
in thread difference b/w undef and empty string

Undef means whatever you design it to mean. For that particular variable. It might mean the exact same thing as an empty string or a zero or something entirely different.

I mean assume you have a variable that's supposed to contain an object (a blessed reference if you like), does an undef in that variable mean "I don't know what the value is or even if there is a value"? I don't think so. It rather means "there is no such object" or "the constructor of the object failed, do find out why". How's that "I don't know what the value is"?

"I don't know what the value is or even if there is a value" would be a good description of free variables in Prolog, but not of ALL undefs in Perl.

Jenda
Enoch was right!
Enjoy the last years of Rome.

  • Comment on Re^2: difference b/w undef and empty string