summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2011-07-07 08:54:59 -0500
committerJesse Luehrs <doy@tozt.net>2011-07-07 08:54:59 -0500
commit1172d8b556c93d35aff699eadfc10f93296d7319 (patch)
treee5e987da2974e3bea12b8e5f64fcbf032e8302ce /lib
parent2c9613c69eded089c42a83d96a2f518d8f2eed83 (diff)
downloadsmartmatch-engine-rjbs-1172d8b556c93d35aff699eadfc10f93296d7319.tar.gz
smartmatch-engine-rjbs-1172d8b556c93d35aff699eadfc10f93296d7319.zip
reimplement the buggy behavior for now
Diffstat (limited to 'lib')
-rw-r--r--lib/smartmatch/engine/core.pm10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/smartmatch/engine/core.pm b/lib/smartmatch/engine/core.pm
index a3c96b9..e172b6c 100644
--- a/lib/smartmatch/engine/core.pm
+++ b/lib/smartmatch/engine/core.pm
@@ -55,6 +55,16 @@ sub match {
}
elsif (type($b) eq 'Object') {
my $overload = overload::Method($b, '~~');
+
+ # XXX this is buggy behavior and may be changed
+ # see http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2011-07/msg00214.html
+ if (!$overload && overload::Overloaded($b)) {
+ $overload = overload::Method($a, '~~');
+ die "no ~~ overloading on $b"
+ unless $overload;
+ return $a->$overload($b, 0);
+ }
+
die "no ~~ overloading on $b"
unless $overload;
return $b->$overload($a, 1);