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)