Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

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 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 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 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???


In reply to Re: Can't use three part version number for CPAN modules by JPeacock
in thread Can't use three part version number for CPAN modules by arc_of_descent

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, 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, 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.
  • Log In?

    What's my password?
    Create A New User
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others making s'mores by the fire in the courtyard of the Monastery: (10)
    As of 2021-01-20 13:46 GMT
    Find Nodes?
      Voting Booth?