Subject: | Lack of $VERSION declaration in M::B::Base causes spurious failures |
Hi,
We received this bug report for CPANPLUS, that it fails loading Module::Build at times:
https://rt.cpan.org/Ticket/Display.html?id=13863
The problem was traced by the user to this section of code:
I found it in .../.cpanplus/5.9.2/build/Module-Build-
0.2611/lib/Module/Build/Base.pm
*UNIVERSAL::VERSION = $old_version;
EU::MM, Module::Installed and CPANPLUS share a regex that tries to parse the version
number from a module. Since there's no $VERSION declaration in the file, this the segment
that is found by this shared regex to be the version declaration for the file -- which is
of course incorrect, and meddles with UNIVERSAL::VERSION when eval'd (which all the
above mentioned modules do with the segment of code they find).
The fix seems simple: add a $VERSION statement to M::B::Base.. it could be as simple as:
$VERSION = $Module::Build::VERSION;
Thanks