From 23d8684148f0af6c180e035ce976efa5874cc2ef Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Sun, 10 Jul 2011 02:39:00 -0500 Subject: reftype(qr//) wasn't REGEXP until 5.12 --- lib/smartmatch/engine/core.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/smartmatch/engine/core.pm b/lib/smartmatch/engine/core.pm index 6769350..df9af82 100644 --- a/lib/smartmatch/engine/core.pm +++ b/lib/smartmatch/engine/core.pm @@ -51,7 +51,10 @@ sub type { if (!defined($thing)) { return 'undef'; } - elsif (blessed($thing) && reftype($thing) ne 'REGEXP') { + elsif (re::is_regexp($thing)) { + return 'Regex'; + } + elsif (blessed($thing)) { return 'Object'; } elsif (my $reftype = reftype($thing)) { @@ -61,9 +64,6 @@ sub type { elsif ($reftype eq 'HASH') { return 'Hash'; } - elsif ($reftype eq 'REGEXP') { - return 'Regex'; - } elsif ($reftype eq 'CODE') { return 'CodeRef'; } -- cgit v1.2.3-54-g00ecf