]> git.vpit.fr Git - perl/modules/Regexp-Wildcards.git/blobdiff - lib/Regexp/Wildcards.pm
Use Scalar::Util::blessed() to check if our objects are blessed
[perl/modules/Regexp-Wildcards.git] / lib / Regexp / Wildcards.pm
index 8d79b936abdc19cb2ce7fcd5c12852d738eb5d60..15b42c79fccf5f0b8122a5db5938bc2d846e1eb0 100644 (file)
@@ -4,6 +4,7 @@ use strict;
 use warnings;
 
 use Carp           qw<croak>;
+use Scalar::Util   qw<blessed>;
 use Text::Balanced qw<extract_bracketed>;
 
 =head1 NAME
@@ -61,7 +62,7 @@ Typesets that mimic the behaviour of Windows and Unix shells are also provided.
 
 sub _check_self {
  croak 'First argument isn\'t a valid ' . __PACKAGE__ . ' object'
-  unless ref $_[0] and $_[0]->isa(__PACKAGE__);
+  unless blessed $_[0] and $_[0]->isa(__PACKAGE__);
 }
 
 my %types = (
@@ -468,7 +469,7 @@ An object module shouldn't export any function, and so does this one.
 
 =head1 DEPENDENCIES
 
-L<Carp> (core module since perl 5), L<Text::Balanced> (since 5.7.3).
+L<Carp> (core module since perl 5), L<Scalar::Util>, L<Text::Balanced> (since 5.7.3).
 
 =head1 CAVEATS