|Pathologically Eclectic Rubbish Lister|
Re: Can't use three part version number for CPAN modulesby JPeacock (Novice)
|on Jan 06, 2006 at 16:26 UTC||Need Help??|
This might serve as a reminder not to use three part version numbers for your CPAN modules.
It should actually act as a reminder that I need to remember to watch out for these threads, so that things don't deteriorate to this point. :(
What TheDamian is suggesting in Perl Best Practices is to use a structured version object, via the version module. All version comparisons DTRT and there aren't any suprises like can be caused with v-strings. As an aside, I was as thunderstruck as anyone to see this recommendation when he made it during his Best Practices Perl talk in 2004. I wasn't convinced that version.pm was ready for prime time yet. I was even more stunned to discover this past summer that Module-Starter-PBP already contained the recommendeduse version; our $VERSION = qv("1.2.3");
stanza. I alerted Andreas to this fact and went back to check in some changes to version.pm based on his tests.
Contrary to what is said in this thread (and in fact in the 0.50 version.POD), Andreas has updated the CPAN indexer to correctly parse version objects and add the value to the index files as a number. That distinction is important since both CPAN and CPANPLUS expect the $VERSION column in the index file to be a floating point number (the old style $VERSION). The version.pm module contains logic to convert between a floating point and a multi-dot version object in an internally consistant manner.
Your problem is that you didn't read the version POD (or you did and my poor documentation skills prevented you from understanding) and tried to mix Numeric Versions with Extended Versions (to use the terminology I've recently adopted). The problem is that your existing CPAN release was done like this:our $VERSION = 0.01;
But that is equivalent to an Extended Version of 0.10.0! Strange but true! The conversion code breaks floating point number implicitely on 3 decimal place boundaries, adding zeros on the right as needed to make up a clean multiple of 3. This is required by the fact that Perl 5.6.0 was equivalent to 5.006.
When you added a new release to CPAN like this:use version; our $VERSION = qv("0.0.3");
the PAUSE indexer correctly noted that this was less than the current CPAN release (remember, equivalent to 0.10.0), and hence, although it was correctly added to your CPAN directory, it will not show up in the index because it isn't "newer" than the older release.
The correct fix is to submit a new release to CPAN like this:use version; our $VERSION = qv("0.11.0");
or whatever suitable increment you see fit, such that it is a higher version than 0.10.0.
There, clear as mud???John