David Golden wrote:
Both have regex code that assumes versions are only digits and periods. (Though CPAN.pm lets it through unless the "version" resembles an available module.)

As I said, the leading 'v' is not _required_, but forcing the version element to be numified would be the wrong thing to do, IMHO.

The META.yml spec doesn't provide any guidance so people have been free to do whatever.

If we view META.yml as a just another YAML file, the "plain scalar" definition guarantees that the data will be treated as a string:

plain scalar
   This is a single line of unquoted text. All plain scalars are auto-
   matic candidates for "implicit transferring". This means that their
   type is determined automatically by examination. Unless they match
   a set of predetermined YAML regex patterns, they will raise a
   parser exception.  The typical uses for this are plain alpha
   strings, integers, real numbers, dates, times and currency.

       - a plain string
       - -42
       - 3.1415
       - 12:34
       - 123 this is an error

I just checked and with or without a leading 'v' the "plain scalar" regex determined that version was a string, not a number in the "Extended Version" case.

Since CPAN is tolerant, it should be a matter of making Module::CPANTS::Analyse version-object aware. And if you are talking about this line:

/usr/lib/perl5/site_perl/5.8.7/Module/CPANTS/Kwalitee/BrokenInstaller.pm:
    if ($buf =~ /VERSION\s*=\s*("|'|)(\d+|\d*\.\d+(?:_\d+)?)\1/m) {

the only time this regex is being used is to compare which release of Module::Install was used (and this code is horrible, I may offer a patch to fix it regardless of what happens here)...

John

--
John Peacock
Director of Information Research and Technology
Rowman & Littlefield Publishing Group
4501 Forbes Boulevard
Suite H
Lanham, MD  20706
301-459-3366 x.5010
fax 301-429-5748

Reply via email to