Michael G Schwern wrote:
On Fri, Apr 01, 2005 at 05:48:47AM -0500, John Peacock wrote:

If a module contains a line that matches the $VERSION regex, yet evaluates to undef inside the indexer, then use the package $VERSION (as defined by the META.yml or Makefile.PL/Build.PL stanza). Only report 'undef' for modules which have no $VERSION stanza at all.


Again I disagree.  This A) introduces yet another versioning heuristic and
lord knows we don't need another and B) the reasoning against it is
dubious (see below).

The behavior of the CPAN indexer is arguably wrong, because it doesn't behave the same way as when the modules are executed, so something has to give. If the indexer was taught to recognize the "assign $VERSION from some other file's $VERSION" and DTRT, that would be better. But reporting 'undef' because of a limitation of the indexer is worse than any other hack, elegant or not. These are not files without a $VERSION assignment at all (where undef is reasonable); these are files that the indexer isn't smart enough to handle the code that is there.


I don't think it is reasonable for the module authors to have to alter their code to make up for a flaw in the indexer (no matter how justifiable the limitation is). Applying the distro version for an indeterminant $VERSION is much less wrong than reporting 'undef' when you can easily tell that is not the case.

I'm not opposed to adding the lines to META.yml; as you said it is easily scriptable. It just doesn't help any existing modules which might be helped by improving the indexer's heuristics...

John

--
John Peacock
Director of Information Research and Technology
Rowman & Littlefield Publishing Group
4720 Boston Way
Lanham, MD 20706
301-459-3366 x.5010
fax 301-429-5747

Reply via email to