I have recently uploaded the first indexed release of WARC to CPAN and found that PAUSE only indexed the top-level module because that is the only module where $VERSION is defined — all other modules simply alias \$WARC::VERSION using a typeglob assignment. Perl itself understands this approach (the WARC testsuite verifies it for each module) but PAUSE and Kwalitee apparently do not.

I believe the regex m/(?:use|require)\s+($PackageName)\s*;\s*\*($PackageName)::VERSION\s*=\s*(?:\\\$|\*)\1::VERSION\s*;/, where $PackageName is a regex matching a Perl package name (tentatively qr/[[:alpha:]][[:alnum:]_:]+/ but there is probably a more precise pattern possible), and tests that $2 is loaded with the current package name and that $1 is loaded with the name of another package in the same distribution would be enough to recognize code using this technique.

Where do I need to contribute code to make this work properly, or is the community fundamentally opposed to applying SPOT here and proper indexing will require all of the modules to contain their own $VERSION values literally?

If all modules must explicitly define $VERSION independently, is it necessary for each module's series of version numbers to be "dense" or is simply copying the release version in which the module was most recently changed suitable? Are there existing tools for maintaining these with code stored in a Git repository or do I need to write such a tool? If I need to write a tool, where would be the appropriate place to put it on CPAN?


In reply to Using a Single Point of Truth for $VERSION in a distribution? by jcb

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.