Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

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.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1016140]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (7)
As of 2018-03-24 11:07 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (298 votes). Check out past polls.