http://qs321.pair.com?node_id=781493


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.