David Golden wrote:
> * perl 5.8.9: Build.PL fails (needs version.pm 0.74 but have version 0)
> * perl 5.8.9 + version.pm: Build.PL fails (needs version.pm 0.74 but
> have version 0)
> * perl 5.10.0: Build.PL fails (needs version.pm 0.74 but have version 0)
> * perl 5.10.0 + version.pm: Build.PL fails (needs version.pm 0.74 but
> have version 0)
>
> I hope that helps in diagnosing the problem.
Yeah, that was actually a red herring. Here's the fix:
=== lib/Module/Build/Version.pm
==================================================================
--- lib/Module/Build/Version.pm (revision 2630)
+++ lib/Module/Build/Version.pm (local)
@@ -48,7 +48,7 @@
use vars qw(@ISA $VERSION $CLASS *declare *qv);
-$VERSION = 0;
+$VERSION = 0.77;
$CLASS = 'version';
@@ -122,6 +122,7 @@
use locale;
use vars qw ($VERSION @ISA @REGEXS);
$VERSION = '0.77';
+$VERSION = eval $VERSION;
push @REGEXS, qr/
^v? # optional leading 'v'
And here's the explanation:
1) The first block alters the inline version.pm code to include the actual
$VERSION for version.pm, instead of the dummy 0 that was there before. The
reason this is necessary is this:
> package Module::Build::Version;
> use strict;
>
> use vars qw($VERSION);
> $VERSION = 0.77;
>
> eval "use version $VERSION";
Module::Build always tries to load the version.pm that matches its internal
code, which in the case of all of your installs meant 0.76. So it loads the
code from __DATA__, which has an explicit $VERSION = 0 line, which fails. I
only tested DBIx::Tree::MaterializedPath, but the other two should be resolved
in the same fashion.
2) The second block is to fix this version.pm ticket:
https://rt.cpan.org/Ticket/Display.html?id=41732
which I mistakenly left out (but spotted while looking at this). It didn't show
up in test version.pm because 0.76_03 being an alpha release, I already had the
eval line...
John