Out of curiosity John, why would need to do an automatic run-time
module load at all?

Adam K

2009/7/19 John Peacock <john.peac...@havurah-software.org>:
> Adam Kennedy opened a ticket against Module::Build, which David Golden 
> correctly
> interpreted as being version.pm's fault (in the pure Perl release only).  I've
> committed a change (and test) that will be part of version-0.77.  The matching
> fix needs to be applied to Module::Build's inline code.
>
> John
>
> === lib/Module/Build/Version.pm
> ==================================================================
> --- lib/Module/Build/Version.pm (revision 2640)
> +++ lib/Module/Build/Version.pm (local)
> @@ -628,15 +628,17 @@
>     my $class = ref($obj) || $obj;
>
>     no strict 'refs';
> -    eval "require $class" unless %{"$class\::"}; # already existing
> -    return undef if $@ =~ /Can't locate/ and not defined $req;
> +    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
>        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;
>
>

Reply via email to