From: Vincent Pit Date: Thu, 25 Aug 2011 11:26:10 +0000 (+0200) Subject: Use Scalar::Util::blessed() to check if our objects are blessed X-Git-Tag: v1.04~2 X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2FRegexp-Wildcards.git;a=commitdiff_plain;h=0acfe1e394d884c4ff93c844467c446873681c24 Use Scalar::Util::blessed() to check if our objects are blessed Scalar::Util is now required. --- diff --git a/Makefile.PL b/Makefile.PL index 1392ee0..1d0fd94 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -11,6 +11,7 @@ $file = "lib/$file.pm"; my %PREREQ_PM = ( 'Carp' => 0, + 'Scalar::Util' => 0, 'Text::Balanced' => 0, ); diff --git a/lib/Regexp/Wildcards.pm b/lib/Regexp/Wildcards.pm index 8d79b93..15b42c7 100644 --- a/lib/Regexp/Wildcards.pm +++ b/lib/Regexp/Wildcards.pm @@ -4,6 +4,7 @@ use strict; use warnings; use Carp qw; +use Scalar::Util qw; use Text::Balanced qw; =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 (core module since perl 5), L (since 5.7.3). +L (core module since perl 5), L, L (since 5.7.3). =head1 CAVEATS