Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^2: undef-safe equality (shorter)

by Roy Johnson (Monsignor)
on Apr 21, 2005 at 22:11 UTC ( #450216=note: print w/ replies, xml ) Need Help??


in reply to Re: undef-safe equality (shorter)
in thread undef-safe equality

But you can do

sub iseq { (!defined $_[0] || $_[0].9) eq (!defined $_[1] || $_[1].9); }
Update - shorter:
1 == keys %{{map {(!defined()||$_.9)=>1} @_}};

Caution: Contents may have been coded under pressure.


Comment on Re^2: undef-safe equality (shorter)
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (5)
As of 2014-08-02 00:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Who would be the most fun to work for?















    Results (53 votes), past polls