In article <[EMAIL PROTECTED]>,
Elaine -HFB- Ashton <[EMAIL PROTECTED]> wrote:
>Yitzchak Scott-Thoennes [[EMAIL PROTECTED]] quoth:
>*>
>*>I thought the alpha/beta distinction was only relevant when there was a
>*>earlier GA release (so CPAN.pm doesn't upgrade 1.01 to 1.01_01 or some
>*>such.) Nevertheless, $VERSION should always be a number so that required
>*>version numbers work without extraneous warnings:
>*>
>*>~ $perl -we'use Date::Roman 1.0'
>*>Argument "1.0.1" isn't numeric in subroutine entry at -e line 1.
>
>1.0 is also an invalid version number as it is defined as a floating point
>number with at least 2 digits following the decimal.
The point is that use Module VERSION does a numeric compare, and if
$VERSION is a string that "isn't numeric", the user gets a warning.
Doesn't matter if you say 1, 1.0, 1.00.
>*>Same thing happens with $VERSION="1.00_01" though, and MakeMaker (e.g.
>*>make dist's tarball name) loses the _ if you only say $VERSION=1.00_01;
>
>Not with my makemaker...at least not with 5.005_03 or 5.6.1. The "_nn" has
>been the semantic for denoting a beta for a long time so MM not dealing
>with it would be a surprise.
Try it:
~/dl/tmp $perl -MExtUtils::MakeMaker -wle'print for $], $ExtUtils::MakeMaker::VERSION'
5.006001
5.45
~/dl/tmp $tar xfz ../Date-Roman-1.0.1.tar.gz
~/dl/tmp $cd Date-Rom*
~/dl/tmp/Date-Roman-1.0.1 $perl -pi.bak -e's/(\$VERSION =).*/$1 1.00_01/'
lib/Date/Roman.pm
~/dl/tmp/Date-Roman-1.0.1 $diff -u0 lib/Date/Roman.pm.bak lib/Date/Roman.pm
--- lib/Date/Roman.pm.bak Tue Apr 16 10:53:16 2002
+++ lib/Date/Roman.pm Thu Apr 18 17:18:48 2002
@@ -13 +13 @@
-$VERSION = '1.0.1';
+$VERSION = 1.00_01
~/dl/tmp/Date-Roman-1.0.1 $perl Makefile.PL
Checking if your kit is complete...
Looks good
Writing Makefile for Date::Roman
~/dl/tmp/Date-Roman-1.0.1 $make dist
[snip]
gzip --best Date-Roman-1.0001.tar
^!
>*>Extensive discussion of this problem occured on perl5-porters in Feb
>*>and Mar under subjects '$VERSION problem', 'UNIVERSAL::version objects',
>*>and 'Argument "1.23_45" isn't numeric in subroutine entry'.
>
>This is a different problem and isn't terribly critical since it's for
>alpha/beta modules and shouldn't keep people from using version numbers
>properly.
"Properly" includes alpha/beta modules. These should have a string
$VERSION= line with the underscore for MakeMaker/CPAN. $XS_VERSION
must also match what MakeMaker sees for bootstrap's version check.
And $VERSION must be numeric for use Module VERSION syntax to work.
>Much of CPAN is bereft of version numbers or valid numbers at
>all so I don't think it's a real sticking point.
I agree that using VERSION at all is good. But we might as well tell folks
how to do it right. For now, for alpha/beta versions that means:
$VERSION = "1.12_01";
$XS_VERSION = $VERSION; # only needed if you have XS code
$VERSION = eval $VERSION;