Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

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

by LanX (Saint)
on Jul 19, 2009 at 23:31 UTC ( [id://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

Replies are listed 'Best First'.
Re^3: What is the best way to compare variables so that different types are non-equal?
by ikegami (Patriarch) 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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://781493]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (6)
As of 2024-04-19 11:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found