Acme-CPANModules-VersionNumber-Perl
view release on metacpan or search on metacpan
perl interpreter itself uses x.y.z convention.
Dotted decimal can be converted to decimal ("numified") form using this
convention: minor and lesser parts are given (at least) three decimal
digits each. For example, 1.2.3 becomes 1.002003. 1.20.3 becomes
1.020003. This can give some surprise which has bitten Perl programmers,
novice and expert alike. In fact, it is the major gotcha when dealing
with version numbers in Perl. For example '0.02' (a decimal form)
numifies to 0.02, but 'v0.02' (a dotted decimal form) numifies to 0.002.
Hence, v0.02 is less than 0.02 or even 0.01 when compared using
version->parse(). Another gotcha is when a module author decides to go
from 0.02 to 0.2.1 or 0.02.1. 0.02 (a decimal form) numifies to 0.02
while 0.2.1 or 0.02.1 (dotted decimal) numifies to 0.002001. Hence,
going from 0.02 to 0.02.1 will actually *decrease* your version number.
I recommend using x.yyy if you use decimal form, i.e. start from 0.001
and not 0.01. It will support you going smoothly to dotted decimal if
you decide to do it one day.
The numification is also problematic when a number part is > 999, e.g.
1.2.1234. This breaks version comparison when comparison is done with
version->parse().
Aside from the abovementioned two styles, there is another: CPAN
distributions/modules can add an underscore in the last part of the
version number to signify alpha/dev/trial release, e.g. 1.2.3_01. PAUSE
will not index such releases, so testers will need to specify an
explicit version number to install, e.g. "cpanm Foo@1.2.3_01". In some
lib/Acme/CPANModules/VersionNumber/Perl.pm view on Meta::CPAN
decimal variant can be used. For example the perl interpreter itself uses x.y.z
convention.
Dotted decimal can be converted to decimal ("numified") form using this
convention: minor and lesser parts are given (at least) three decimal digits
each. For example, 1.2.3 becomes 1.002003. 1.20.3 becomes 1.020003. This can
give some surprise which has bitten Perl programmers, novice and expert alike.
In fact, it is the major gotcha when dealing with version numbers in Perl. For
example '0.02' (a decimal form) numifies to 0.02, but 'v0.02' (a dotted decimal
form) numifies to 0.002. Hence, v0.02 is less than 0.02 or even 0.01 when
compared using version->parse(). Another gotcha is when a module author decides
to go from 0.02 to 0.2.1 or 0.02.1. 0.02 (a decimal form) numifies to 0.02 while
0.2.1 or 0.02.1 (dotted decimal) numifies to 0.002001. Hence, going from 0.02 to
0.02.1 will actually *decrease* your version number. I recommend using x.yyy if
you use decimal form, i.e. start from 0.001 and not 0.01. It will support you
going smoothly to dotted decimal if you decide to do it one day.
The numification is also problematic when a number part is > 999, e.g. 1.2.1234.
This breaks version comparison when comparison is done with version->parse().
Aside from the abovementioned two styles, there is another: CPAN
distributions/modules can add an underscore in the last part of the version
number to signify alpha/dev/trial release, e.g. 1.2.3_01. PAUSE will not index
such releases, so testers will need to specify an explicit version number to
install, e.g. `cpanm Foo@1.2.3_01`. In some cases you need to pay attention when
comparing this kind of version numbers.
lib/Acme/CPANModules/VersionNumber/Perl.pm view on Meta::CPAN
decimal variant can be used. For example the perl interpreter itself uses x.y.z
convention.
Dotted decimal can be converted to decimal ("numified") form using this
convention: minor and lesser parts are given (at least) three decimal digits
each. For example, 1.2.3 becomes 1.002003. 1.20.3 becomes 1.020003. This can
give some surprise which has bitten Perl programmers, novice and expert alike.
In fact, it is the major gotcha when dealing with version numbers in Perl. For
example '0.02' (a decimal form) numifies to 0.02, but 'v0.02' (a dotted decimal
form) numifies to 0.002. Hence, v0.02 is less than 0.02 or even 0.01 when
compared using version->parse(). Another gotcha is when a module author decides
to go from 0.02 to 0.2.1 or 0.02.1. 0.02 (a decimal form) numifies to 0.02 while
0.2.1 or 0.02.1 (dotted decimal) numifies to 0.002001. Hence, going from 0.02 to
0.02.1 will actually I<decrease> your version number. I recommend using x.yyy if
you use decimal form, i.e. start from 0.001 and not 0.01. It will support you
going smoothly to dotted decimal if you decide to do it one day.
The numification is also problematic when a number part is > 999, e.g. 1.2.1234.
This breaks version comparison when comparison is done with version->parse().
Aside from the abovementioned two styles, there is another: CPAN
distributions/modules can add an underscore in the last part of the version
number to signify alpha/dev/trial release, e.g. 1.2.3_01. PAUSE will not index
such releases, so testers will need to specify an explicit version number to
install, e.g. C<cpanm Foo@1.2.3_01>. In some cases you need to pay attention when
comparing this kind of version numbers.
( run in 1.165 second using v1.01-cache-2.11-cpan-4505f990765 )