From: Brandon Black Date: Tue, 24 Apr 2007 07:58:44 +0000 (-0500) Subject: Re: [Andreas J. Koenig] C3 MRO breaks Params::Util and Graph X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=05a4b9b1cf732bd593a66695e9160c88fe43217c;p=p5sagit%2Fp5-mst-13.2.git Re: [Andreas J. Koenig] C3 MRO breaks Params::Util and Graph From: "Brandon Black" Message-ID: <84621a60704240558q7ff65863l803c6f9b9b8ca4a6@mail.gmail.com> p4raw-id: //depot/perl@31073 --- diff --git a/ext/DynaLoader/t/DynaLoader.t b/ext/DynaLoader/t/DynaLoader.t index 3d74bc7..a698a8f 100644 --- a/ext/DynaLoader/t/DynaLoader.t +++ b/ext/DynaLoader/t/DynaLoader.t @@ -25,6 +25,7 @@ BEGIN { %modules = ( # ModuleName => q| code to check that it was loaded |, + 'List::Util' => q| ::is( ref List::Util->can('first'), 'CODE' ) |, # 5.7.2 'Cwd' => q| ::is( ref Cwd->can('fastcwd'),'CODE' ) |, # 5.7 ? 'File::Glob' => q| ::is( ref File::Glob->can('doglob'),'CODE' ) |, # 5.6 $db_file => q| ::is( ref $db_file->can('TIEHASH'), 'CODE' ) |, # 5.0 @@ -32,7 +33,7 @@ BEGIN { 'Time::HiRes'=> q| ::is( ref Time::HiRes->can('usleep'),'CODE' ) |, # 5.7.3 ); -plan tests => 27 + keys(%modules) * 2; +plan tests => 22 + keys(%modules) * 3; # Try to load the module diff --git a/lib/overload.pm b/lib/overload.pm index fdc1cfe..5faaad3 100644 --- a/lib/overload.pm +++ b/lib/overload.pm @@ -1,6 +1,6 @@ package overload; -our $VERSION = '1.05'; +our $VERSION = '1.06'; sub nil {} @@ -72,7 +72,11 @@ sub OverloadedStringify { sub Method { my $package = shift; - $package = ref $package if ref $package; + if(ref $package) { + require Scalar::Util; + $package = Scalar::Util::blessed($package); + return undef if !defined $package; + } #my $meth = $package->can('(' . shift); ov_method mycan($package, '(' . shift), $package; #return $meth if $meth ne \&nil;