Skip Menu |

This queue is for tickets about the Scalar-Does CPAN distribution.

Report information
The Basics
Id: 80121
Status: resolved
Priority: 0/
Queue: Scalar-Does

People
Owner: Nobody in particular
Requestors: DAMI [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Unimportant
Broken in: (no value)
Fixed in: (no value)



Subject: under $^W, warning on undef
The following program : use Scalar::Does; $^W = 1; print does(undef, 'HASH') ? 'yes' : 'no'; produces this warning : Use of uninitialized value in subroutine entry at D:/strawberry/perl/lib/overload.pm line 112. So it seems that the call to mro::get_linear_isa should first check if $package is defined. If I replace "$^W = 1" by "use warnings", everything is fine. I know, $^W is obsolete, but I came to this problem because Module::Build still uses it. By the way, thanks for Scalar::Does, it's a great module. I'm in the process of converting Data::Domain to depend on this. Before that I've been struggling with various checks of refs, reftypes, overloads, etc.; now it's very nice to have all this encapsulated in a single call.
Thanks for the bug report. Changing Scalar::Does::overloads to this... sub overloads ($;$) { my ($thing, $role) = @_; # curry (kinda) return sub { overloads(shift, $thing) } if @_==1; return unless defined $thing; ## Added this line! goto \&overload::Method; } ... fixes things. I've made this change in my repository and will push a new version to CPAN in a few days.
Resolved in 0.007