diff options
author | Jesse Luehrs <doy@tozt.net> | 2011-07-10 02:39:00 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2011-07-10 02:39:00 -0500 |
commit | 23d8684148f0af6c180e035ce976efa5874cc2ef (patch) | |
tree | b3bdee83ca0bed514033cf008929fbadc0c72210 /lib | |
parent | 21f865e032ce283634dca60ce72767782defca52 (diff) | |
download | smartmatch-engine-core-23d8684148f0af6c180e035ce976efa5874cc2ef.tar.gz smartmatch-engine-core-23d8684148f0af6c180e035ce976efa5874cc2ef.zip |
reftype(qr//) wasn't REGEXP until 5.12
Diffstat (limited to 'lib')
-rw-r--r-- | lib/smartmatch/engine/core.pm | 8 |
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'; } |