Subject: | Version numbering scheme (eg, '1.966_000') not being handled correctly. |
The $VERSION numbering scheme, eg. "1.966_000" is not in line with the
recommendation in perlmodstyle, and in fact can break modules that
attempt a numeric comparison to verify they're using a "new enough"
version of Parse::RecDescent.
------- Current Code: ---------
package Parse::RecDescent;
use Carp;
use vars qw ( $AUTOLOAD $VERSION );
my $ERRORS = 0;
our $VERSION = '1.966_000';
# BUILDING A PARSER
-------- Suggested patch: ----------
package Parse::RecDescent;
use Carp;
use vars qw ( $AUTOLOAD $VERSION );
my $ERRORS = 0;
our $Version = '1.966_000';
$VERSION = eval $VERSION;
# BUILDING A PARSER
----------------------------------
Relevant quote from 'perlmodstyle':
If you want to release a 'beta' or 'alpha' version of a module but don't
want CPAN.pm to list it as most recent use an '_' after the regular
version number followed by at least 2 digits, eg. 1.20_01. If you do
this, the following idiom is recommended:
$VERSION = "1.12_01";
$XS_VERSION = $VERSION; # only needed if you have XS code
$VERSION = eval $VERSION;
With that trick MakeMaker will only read the first line and thus read
the underscore, while the perl interpreter will evaluate the $VERSION
and convert the string into a number. Later operations that treat
$VERSION as a number will then be able to do so without provoking a
warning about $VERSION not being a number.
------------------------------
Currently any code that uses Parse::RecDescent and tests the version
number numerically will see a warning. An example is the 'grammar.pm'
module within the Inline::CPP distribution. The Inline::CPP test suite
will trigger the warning repeatedly on any system with Parse::RecDescent
1.966_000 installed.