in reply to Module version numbers best practice
Don't use version.pm and don't listen to Perl Best Practices on this one. This is a classic example of somebody writing up a recommendation on something brand new (the author's own creation). A few months of experience showed problems with the idea, but it isn't like the book is going to be republished to discuss those.
Make your version numbers very simple, values that can be interpreted as numbers and that always sort the same whether treated as numbers or as strings. Avoid trying to assign meaning to your version strings or parts of them.
So I just always follow Perl's lead and use 1.001_001 forms of version numbers. Though I avoid Perl's idea of assigning meaning to whether or not the middle part is odd or even.
I also skip multiples of 10 for the 2nd and 3rd parts and don't let the third part go above 99. If the 2nd part goes above 99, then I skip to 111 to avoid the second digit being 0. This is so the break-up is obvious even when the '_' is not present because you are seeing just the numeric value.
If you expect to get past version 9, then you should start with version 10 so you can avoid string sorting breaking down when you go from 9.x to 10.x.
Set you version number very simply such as via:
our $VERSION = 100.001_001;
so all of the different things that try to introspect for your version number without running your code have no problems.
- tye
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Module version numbers best practice (KISS)
by BrowserUk (Patriarch) on Oct 18, 2013 at 19:09 UTC | |
by LanX (Saint) on Oct 18, 2013 at 19:21 UTC | |
by Anonymous Monk on Oct 19, 2013 at 03:03 UTC | |
by BrowserUk (Patriarch) on Oct 19, 2013 at 07:01 UTC | |
by Anonymous Monk on Oct 19, 2013 at 07:05 UTC | |
| |
by BrowserUk (Patriarch) on Oct 18, 2013 at 19:24 UTC | |
by LanX (Saint) on Oct 18, 2013 at 19:26 UTC |