On 7/22/09 7:09 PM, John Peacock wrote:
OK, no need to worry, I worked around it some other way which
should be workable and doesn't rely on run-time loading at all.
OK, here is the patch for M::B for this problem. This works because of
how narrow the case is that has to go this way...
John
=== lib/Module/Build/Version.pm
==================================================================
--- lib/Module/Build/Version.pm (revision 2644)
+++ lib/Module/Build/Version.pm (local)
@@ -628,17 +628,13 @@
my $class = ref($obj) || $obj;
no strict 'refs';
- unless (%{"$class\::"}) { # class not already loaded
- eval "require $class";
- return undef if $@ =~ /Can't locate/ and not defined $req;
- }
-
- if ( not %{"$class\::"} and $]>= 5.008) { # file but no package
+ if ( exists $INC{"$class.pm"} and not %{"$class\::"} and $]>= 5.008) {
+ # file but no package
require Carp;
Carp::croak( "$class defines neither package nor VERSION"
."--version check failed");
}
-
+
my $version = eval "\$$class\::VERSION";
if ( defined $version ) {
local $^W if $]<= 5.008;