diff options
-rw-r--r-- | lib/overload.pm | 6 | ||||
-rw-r--r-- | lib/overload.t | 10 | ||||
-rw-r--r-- | pod/perldelta.pod | 8 |
3 files changed, 21 insertions, 3 deletions
diff --git a/lib/overload.pm b/lib/overload.pm index 7d09d69e05..31c88b75df 100644 --- a/lib/overload.pm +++ b/lib/overload.pm @@ -1,6 +1,6 @@ package overload; -our $VERSION = '1.10'; +our $VERSION = '1.11'; sub nil {} @@ -57,7 +57,9 @@ sub ov_method { my $globref = shift; return undef unless $globref; my $sub = \&{*$globref}; - return $sub if $sub ne \&nil; + require Scalar::Util; + return $sub + if Scalar::Util::refaddr($sub) != Scalar::Util::refaddr(\&nil); return shift->can($ {*$globref}); } diff --git a/lib/overload.t b/lib/overload.t index 417c1cb043..ef65ea534d 100644 --- a/lib/overload.t +++ b/lib/overload.t @@ -48,7 +48,7 @@ package main; $| = 1; BEGIN { require './test.pl' } -plan tests => 4881; +plan tests => 4882; use Scalar::Util qw(tainted); @@ -1999,4 +1999,12 @@ fresh_perl_is 'use overload from the main package' ; +{ + package blessed_methods; + use overload '+' => sub {}; + bless overload::Method __PACKAGE__,'+'; + eval { overload::Method __PACKAGE__,'+' }; + ::is($@, '', 'overload::Method and blessed overload methods'); +} + # EOF diff --git a/pod/perldelta.pod b/pod/perldelta.pod index a1430ad4aa..73a90d258b 100644 --- a/pod/perldelta.pod +++ b/pod/perldelta.pod @@ -244,6 +244,14 @@ C<NEXT> has been upgraded from version 0.64 to 0.65. =item * +C<overload> has been upgraded from version 1.10 to 1.11. + +C<overload::Method> can now handle subroutines that are themselves blessed +into overloaded classes +L<[perl #71998]|http://rt.perl.org/rt3//Public/Bug/Display.html?id=71998>. + +=item * + C<PathTools> has been upgraded from version 3.31_01 to 3.33. =item * |