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

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

by LanX (Canon)
on Jul 19, 2009 at 23:31 UTC ( #781493=note: print w/ replies, xml ) Need Help??


in reply to Re: 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?

Regex pattern objects are magical. Overloading doesn't even come into play.

so what about this???

package Regexp; use overload q{""} => sub {return "overloaded" } ; package main; my $rx = qr/a/; print $rx;
output: overloaded

Cheers Rolf

UPDATE: Finally got it! 8)


Comment on Re^2: What is the best way to compare variables so that different types are non-equal?
Select or Download Code
Re^3: What is the best way to compare variables so that different types are non-equal?
by ikegami (Pope) on Jul 20, 2009 at 08:09 UTC

    so what about this???

    I'm not sure what you are asking.

    You transformed the class. Of course my statements about the original class won't necessarily apply to the transformed class.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (12)
As of 2014-09-02 18:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite cookbook is:










    Results (28 votes), past polls