Subject: | die on $VERSION set by base.pm |
Date: | Tue, 15 Mar 2011 11:19:27 +1100 |
To: | bug-Test-ConsistentVersion [...] rt.cpan.org |
From: | Kevin Ryde <user42 [...] zip.com.au> |
In one of my dists I had a module without an explicit $VERSION and which
ended up being set by base.pm. Test::ConsistentVersion (0.2.3) with
recent debian i386 perl 5.10.1 died with
Invalid version format (non-numeric data) at /home/gg/perl/lib/Test/ConsistentVersion.pm line 94.
The offending data is
$VERSION = '-1, set by base.pm';
It arose from a subclass doing a "use base 'Foo'" of the Foo with no
$VERSION. If "use version" is in use then when checking Foo the
_check_module_versions() code $module->VERSION throws an error.
It'd be good if Test::ConsistentVersion could catch a croak from
$module->VERSION, instead of die()-ing out completely.
It could report a failing $module->VERSION as an "inconsistent" version,
inconsistent in the sense of not working at all :-). It could also dig
into ${"${module}::VERSION"} directly to show the offending data as a
diagnostic, to give a hint what's wrong.
I think the $module->VERSION call is subtly different according to
whether you've loaded version.pm or not. Without version.pm it's more
relaxed, and presumably in older perl too.