Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
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 chanting in the Monastery: (15)
As of 2015-07-07 21:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (93 votes), past polls