Skip Menu |

This queue is for tickets about the Module-Pluggable CPAN distribution.

Report information
The Basics
Id: 21027
Status: resolved
Priority: 0/
Queue: Module-Pluggable

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

Bug Information
Severity: Normal
Broken in: 3.1
Fixed in: (no value)



Subject: running make test + devel cover throws a warning
I was running Devel::Cover on the latest Catalyst distro, when i noticed a warning for almost every test that ran: Use of uninitialized value in pattern match (m//) at /usr/local/share/perl/5.8.7/Module/Pluggable/Object.pm line 45. Line 45 is this: my @SEARCHDIR = exists $INC{"blib.pm"} && $filename =~ m!(^|/)blib/! ? grep {/blib/} @INC : @INC; It appears that $filename is undef at some point, so by adding a simple check we get around the warning: my @SEARCHDIR = exists $INC{"blib.pm"} && defined $filename && $filename =~ m!(^|/)blib/! ? grep {/blib/} @INC : @INC; Presto. -Brian
I'm seeing the same problem under Module::Pluggable v3.5. I think the problem is code refs in @INC. The simple attached patch makes the warnings go away for me. -- Chris
--- /Users/chris/perl/lib/perl5/site_perl/Module/Pluggable/Object.pm 2007-01-29 17:13:00.000000000 -0600 +++ inc/Module/Pluggable/Object.pm 2007-03-25 11:23:45.000000000 -0500 @@ -42,7 +42,8 @@ # check to see if we're running under test - my @SEARCHDIR = exists $INC{"blib.pm"} && $filename =~ m!(^|/)blib/! ? grep {/blib/} @INC : @INC; + my @scalar_inc = grep {!ref $_} @INC; + my @SEARCHDIR = exists $INC{"blib.pm"} && $filename =~ m!(^|/)blib/! ? grep {/blib/} @scalar_inc : @scalar_inc; # add any search_dir params unshift @SEARCHDIR, @{$self->{'search_dirs'}} if defined $self->{'search_dirs'};
On Sun Mar 25 12:28:21 2007, CDOLAN wrote: Show quoted text
> I'm seeing the same problem under Module::Pluggable v3.5. I think the > problem is code refs in @INC. The simple attached patch makes the > warnings go away for me. > > -- Chris
Err oops, no, that patch does not solve the problem. Never mind... I think BRICAS' patch is better.
Fixed in 3.7 which is on its way to CPAN right now - sorry it took so long.