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
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |