diff options
-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'; } |