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