Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^4: What is the best way to compare variables so that different types are non-equal?

by jdporter (Canon)
on Jul 21, 2009 at 22:27 UTC ( #782110=note: print w/ replies, xml ) Need Help??


in reply to Re^3: What is the best way to compare variables so that different types are non-equal?
in thread What is the best way to compare variables so that different types are non-equal?

True enough.

sub comparifier { no warnings 'uninitialized'; # because blessed() and reftype() can + return undef. my $sep = pack 'N', rand 2**15; blessed($_[0]) . $sep . reftype($_[0]) . $sep . $_[0] eq blessed($_[1]) . $sep . reftype($_[1]) . $sep . $_[1] }
Between the mind which plans and the hands which build, there must be a mediator... and this mediator must be the heart.


Comment on Re^4: What is the best way to compare variables so that different types are non-equal?
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (9)
As of 2014-12-26 21:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (176 votes), past polls