From 080e26520786d5a07f603698ea31057a26a73ed2 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Thu, 7 Jul 2011 03:18:06 -0500 Subject: another thing the smart match docs got wrong --- lib/smartmatch/engine/core.pm | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'lib') 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; } -- cgit v1.2.3