diff options
-rw-r--r-- | lib/smartmatch/engine/core.pm | 9 |
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; } |