Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: How come undef eq '' ??

by Anonymous Monk
on Jan 30, 2013 at 19:20 UTC ( #1016140=note: print w/ replies, xml ) Need Help??


in reply to How come undef eq '' ??

That's also why Perl calls itself a pragmatic language. Its purpose is to get stuff done, not to be an NP-complete problem or the expression of what some academic's notion of a perfect language ought to be. You're doing a string comparison. One value happens to be undefined. Do you blow up the program? No. You keep going, especially if you've not been told to be strict or to use warnings. An empty-string is the most plausible string representation of an undefined-value. Or at least it was at some time to someone. So that's what it does.


Comment on Re: How come undef eq '' ??

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1016140]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (13)
As of 2014-11-27 14:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (186 votes), past polls