Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Can't use three part version number for CPAN modules (don't)

by tye (Sage)
on Jan 04, 2006 at 17:15 UTC ( [id://520963]=note: print w/replies, xml ) Need Help??


in reply to Can't use three part version number for CPAN modules

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":

  • The sort order is obvious to both people and to programs
  • Two different versions must have different version numbers
  • Version numbers "increase"

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        

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://520963]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2024-04-24 22:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found