summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2011-07-07 03:18:06 -0500
committerJesse Luehrs <doy@tozt.net>2011-07-07 03:18:06 -0500
commit080e26520786d5a07f603698ea31057a26a73ed2 (patch)
treea89e27ef483eed12abdc70ee2ad504f949bce153 /lib
parent0aad4a4babd33bc37a2db3a0c4451fe418c3446b (diff)
downloadsmartmatch-engine-rjbs-080e26520786d5a07f603698ea31057a26a73ed2.tar.gz
smartmatch-engine-rjbs-080e26520786d5a07f603698ea31057a26a73ed2.zip
another thing the smart match docs got wrong
Diffstat (limited to 'lib')
-rw-r--r--lib/smartmatch/engine/core.pm9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/smartmatch/engine/core.pm b/lib/smartmatch/engine/core.pm
index 2c5d94c..27a5c92 100644
--- a/lib/smartmatch/engine/core.pm
+++ b/lib/smartmatch/engine/core.pm
@@ -124,15 +124,16 @@ sub match {
return $a->$overload($b, 0) if $overload;
}
- if (type($b) eq 'Num') {
+ if (type($a) eq 'undef') {
+ return !defined($b);
+ }
+ elsif (type($b) eq 'Num') {
+ no warnings 'uninitialized', 'numeric'; # ugh
return $a == $b;
}
elsif (type($a) eq 'Num' && type($b) eq 'numish') {
return $a == $b;
}
- elsif (type($a) eq 'undef') {
- return !defined($b);
- }
else {
return $a eq $b;
}