summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2011-07-10 02:39:00 -0500
committerJesse Luehrs <doy@tozt.net>2011-07-10 02:39:00 -0500
commit23d8684148f0af6c180e035ce976efa5874cc2ef (patch)
treeb3bdee83ca0bed514033cf008929fbadc0c72210
parent21f865e032ce283634dca60ce72767782defca52 (diff)
downloadsmartmatch-engine-core-23d8684148f0af6c180e035ce976efa5874cc2ef.tar.gz
smartmatch-engine-core-23d8684148f0af6c180e035ce976efa5874cc2ef.zip
reftype(qr//) wasn't REGEXP until 5.12
-rw-r--r--lib/smartmatch/engine/core.pm8
1 files 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';
}