Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: undef-safe equality

by ysth (Canon)
on Apr 22, 2005 at 05:22 UTC ( #450274=note: print w/ replies, xml ) Need Help??


in reply to undef-safe equality

Is there some value like "" that you want a NULL to be considered equal to? If so,

if ( ($ret->{val1}||"") eq ($this->{val1}||"") ) ...
Otherwise,
if ( defined($ret->{val1}) == defined($this->{val1}) && ($ret->{val1}||"") eq ($this->{val1}||"") ) ...


Comment on Re: undef-safe equality
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (3)
As of 2014-09-23 04:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (210 votes), past polls