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
    Make your version numbers very simple
    1. values that can be interpreted as numbers and that always sort the same whether treated as numbers or as strings
    2. Avoid trying to assign meaning to your version strings or parts of them.
    3. use 1.001_001 form
    4. avoid Perl's idea of assigning meaning to whether or not the middle part is odd or even
    5. skip multiples of 10 for the 2nd and 3rd parts
    6. don't let the third part go above 99
    7. if the 2nd part goes above 99, skip to 111to avoid the second digit being 0.
    8. If you expect to get past version 9, then you should start with version 10

    8 steps to simplicity :)


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.

        Better addressed to the OP?

        Its sarcasm

        The Inter:preter

        NOT EVEN CLOSE. It would be completely useless, and completely lost on him.

        But if it would be; it would be up to tye to point that out; not his lap dog.

        YOU really are very bad at this aren't you.


        With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
        Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
        "Science is about questioning the status quo. Questioning authority".
        In the absence of evidence, opinion is indistinguishable from prejudice.