I'm looking for some recommendations on best-practices for version numbers in modules. There's several different "standard" approaches out there, but there doesn't seem to be a lot of consensus in actual pracice. I'm still not sure if we're supposed to be using v-strings or not, or "our" vs "use vars" for that matter, and I've other questions, too. After playing with version number parsing in response to Help update the Phalanx 100, it's clear that TIMTOWTDI rules on CPAN with distributions numbered all sorts of strange ways. I'd like to spark some discussion on the topic and see what people's latest thoughts are. Background reading for this discussion could include Everything you wanted to know about Module Version Numbers and Checking and the version module, the VERSION_FROM section of ExtUtils::MakeMaker, and Other Conventions from PAUSE.

Here are some questions (in no particular order):

  1. What is the current status of v-strings? Should they be used? If so, how? Should we be using version to provide backward compatibility? (version requires only perl 5.005_03.)
  2. "our" or "use vars"? How important is compatibility to perl prior to 5.6? (How much perl 5.005 is still in use in the wild?)
  3. Is there consensus on the best way to number versions? major.minor.release? How should major.minor.release compare to major.minor_release (i.e. an "alpha" release? (verson treats 1.3.0 < 1.3_1 < 1.3.1) I'd assume that forms like "1.2b" and "1.2_pre3" should not be used?
  4. How are people integrating version numbering with their source control systems? CVS approaches are plentiful. How are people handling this for subversion or other systems that maintain global repository revision numbers?
  5. What is a good way to synchronize version numbers across several .pm files in a distribution? Separate version numbers in each file updated by hand (or with a perl one-liner)? What about having each package require a "master" .pm and using its version number? Other approaches?
  6. What is the best way to prepare for forward compatibility with perl 5.10 or perl6?
  7. What do PAUSE and CPAN use internally to parse version numbers?
  8. What other things about module versioning do you wish you knew?

I'd love to hear answers to any/all of these questions or to see additional questions on the same topic.

Thanks very much

-xdg

Code posted by xdg on PerlMonks is public domain. It has no warranties, express or implied. Posted code may not have been tested. Use at your own risk.

Update: Several people have commented that v-strings are deprecated, but I'm not sure this is entirely true. From what I can see, the "version" object is going into the core, and its documentation suggests that only the leading-v form "v10.2" is being deprecated, whereas bare numbers with two or more decimal places will continue to be treated as v-strings. The documentation for version as included in perl-5.9.1 certainly has a lot to say (almost too much) on the topic. (AM's comment about his/her brain popping is apropos.) Can anyone involved in perl 5.9/5.10/perl6 shed some light on the direction of v-strings?

Update 2: After reading comments here, reading version several times, and researching mailing lists and even code for Module::Build and ExtUtils::MakeMaker, I've come to the personal conclusion that version is headed in the right direction, but won't be appropriate for widespread usage until it has better support within Module::Build and ExtUtils::MakeMaker. See this thread and this post in particular.


In reply to Seeking thoughts on version numbers in modules by xdg

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.