Skip Menu |

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

Report information
The Basics
Id: 105928
Status: rejected
Priority: 0/
Queue: Module-Runtime

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

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



Subject: Changes to use_package_optimistically cause unnecessary failures for a number of modules
This change is causing a number of modules that depend on Module::Runtime to fail: If a I<VERSION> is specified, the C<VERSION> method of the loaded package is called with the specified I<VERSION> as an argument. This normally serves @@ -379,11 +377,13 @@ function work just like L</use_module>. sub use_package_optimistically($;$) { my($name, $version) = @_; - check_module_name($name); + my $fn = module_notional_filename($name); eval { local $SIG{__DIE__}; require_module($name); }; die $@ if $@ ne "" && - $@ !~ /\ACan't locate .+ at \Q@{[__FILE__]}\E line/s; - $name->VERSION($version) if defined $version; + ($@ !~ /\ACan't locate \Q$fn\E .+ at \Q@{[__FILE__]}\E line/s || + $@ =~ /^Compilation\ failed\ in\ require + \ at\ \Q@{[__FILE__]}\E\ line/xm); + $name->VERSION($version) if @_ >= 2; return $name; } Reverting to $name->VERSION($version) if defined $version; instead of $name->VERSION($version) if @_ >= 2; Fixes the problem. You can replicate the problem this way: cpanm https://cpan.metacpan.org/authors/id/D/DR/DRTECH/Elastic-Model-0.28.tar.gz
This is a dupe of RT#92989.