This might serve as a reminder not to use three part version numbers for your CPAN modules.
After reading Perl Best Practices and considering the advantage of using three part version numbers (like 0.0.3) over the usual CPAN version numbers like (0.03), and also that I use three part version numbers for my other non-CPAN modules and scripts, I decided to upload my latest module revision as 0.0.3, the earlier version being 0.01
Here's what I got from the PAUSE indexer report. A status of "Falling revision number". The Indexer was somehow converting "0.0.3" to "0.000003", and that being less than "0.01", hence the error.
Update:
The module actually does display on the CPAN web site with version 0.0.3, so I'm not sure why I got that message from the PAUSE indexer. Additionally, 0.0.3 does not show up in my 02packages.details.txt in my .cpan directory.
I guess the best I can do, is delete the 0.01 version from my CPAN dir, let it vanish from the index, and then upload version 0.0.3
Here's what I got from the PAUSE indexer report. A status of "Falling revision number". The Indexer was somehow converting "0.0.3" to "0.000003", and that being less than "0.01", hence the error.
Code?
Take a look at things like Class::Std do it.
In [ID://503983], [ID://107600] mentions that the PAUSE indexer does not handle the [CPAN://version] module correctly, so I'm not sure if its changed now. The VERSION variable in my module was set as
our $VERSION = "0.0.3";
our $VERSION = "0.0.3";
If you're following [TheDamian]'s advice you'll want to use the [cpan://version] module instead of a plain string. Something like:
use version; our $VERSION = qv( '0.0.0' );
and adding [cpan://version] to your modules prerequisites. NOTE: it's important to keep the use version on the same line since many modules grep out the line with $VERSION and eval it to get the version number out.
More accurately, this would be a warning not to mix two-part and three-part version numbers. version works fine if you use three-part version numbers exclusively.
Dear Rohan
My simple and not quite finished module got in OK yesterday: Catalyst::Plugin::Email::Page
I used module::starter::PBP to create it.
Although castaway made me change it today to Catalyst-Plugin-Email-Page-0.2 and now I use our $VERSION = '0.2';
You may also want to look at Seeking thoughts on version numbers in modules. I personally don't think version.pm and 3 part version strings are ready for prime time quite yet.
-xdg
Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.
Here's what I got from the PAUSE indexer report. A status of "Falling revision number". The Indexer was somehow converting "0.0.3" to "0.000003", and that being less than "0.01", hence the error.While I think that converting "0.0.3" to "0.000003" isn't the correct way (and the PAUSE indexer contains more 'surprises', for instance, it thinks that "0.2" is a newer version than "0.11", because it considers "0.2" to be a short hand for "0.002" and "0.11" a short hand for "0.011" - not that this is an idea of PAUSE - Andreas is just doing what perl is doing itself), I think that most people will consider "0.01" to be a newer release than "0.0.3". "0.01" reads as major release 0, minor release 1. "0.0.3" reads as major release 0, minor release 0, patch level 3. I don't think you should interpret Damian's suggestion to use three part version numbers as an invitation to just take your two part version number and insert an extra dot. I would consider "0.01" and "0.1.0" to be equivalent, and hence, "0.0.3" to be an older release.
I suggest you keep 0.01 in your CPAN dir, and name your new release "0.1.3", or "0.2.3", and count from there.
I think that most people will consider "0.01" to be a newer release than "0.0.3". "0.01" reads as major release 0, minor release 1. "0.0.3" reads as major release 0, minor release 0, patch level 3. I don't think you should interpret Damian's suggestion to use three part version numbers as an invitation to just take your two part version number and insert an extra dot. I would consider "0.01" and "0.1.0" to be equivalent, and hence, "0.0.3" to be an older release.
Thanks for the insight.
I don't know what TheDamian is recommending, but you might find Re: Versioning modules in a package worth a read.
I have to say that using v-string-like version "numbers" is wishful thinking not a "best practice". It might be a best practice in another few years. Right now, it is just asking for problems, many of which will be problems not for you but for the people who try to use your module and thus are the types of problems that it is even more important to avoid.
My suggestion to you is to upload version 0.0101 or 0.0104 or 0.0204 or 0.02004 or such of your module. Treating the purpose of the segments of your chosen version "number" too strictly is a mistake. You appear to be quite reluctant to increment the middle part of your version number; please don't be. What is important about version "numbers":
Other considerations should be treated gingerly. I've seen tons of examples of people trying to assign meaning to certain aspects of version numbers that result in problems. For example, there is a CPAN module that tried to make the integer part of the version number match the release year. A minor "oops" followed by a too-hasty (IMHO) correction means that this module is now version 9999.xxx.
I've previous written versions as:
use vars qw( $VERSION ); $VERSION= 1.01_03;
But I worry that the "_" being there in the Perl source code but not there when you do:
print $My::Module::VERSION
could be a source for confusion that I can avoid (note that I don't consider using "our" to be a best practice either).
Version numbers like "1.2.3" are harder for computers to sort and are less clear how to handle in Perl. The advantages of "1.2.3" over 1.02003 are quite minor, as far as I can tell. So I much prefer version numbers be used that are trivial for both computers and people to sort and that are obviously just numbers (but sort correctly as strings as well) and so how to deal with them is obvious as well.
(No, I have not yet had a module make it to version 10.xxx. I doubt I'll have this "problem" to address. Though, if I do, I might jump from 4.x to 500.x then from 699.x to 7000.x, etc. and just rename the module if I get close to version 999999.xx :)
Update: I forgot to mention to avoid trailing 0s on the latter parts of your version numbers. So if you go with x.yyzzz, then avoid (skip over) version numbers like 1.00012, 1.01010, 1.10020.
- [tye]
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 recommended
use 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???
Johnperlmonks.org content © perlmonks.org and adrianh, Anonymous Monk, arc_of_descent, BrowserUk, ghenry, jdhedden, JPeacock, Perl Mouse, PodMaster, tirwhan, tye, xdg
prlmnks.org © 2006 edmund von der burg (eccles & toad)
v 0.03