Discussion:
version.pm and developer version numbers
Jeffrey Thalhammer
2012-07-27 19:48:56 UTC
Permalink
I just discovered that version.pm always treats version numbers with an underscore as less than the equivalent version number without the underscore. So "6.63_02" is less than "6.6302". Is it it just me, or does that seem crazy? Dealing with $VERSION numbers in Perl is hard enough as it is. This doesn't help.

-Jeff
David Golden
2012-07-27 20:34:34 UTC
Permalink
It's crazy. But it's been that way since Perl 5.10.0 in 2007. So now
we're stuck with it.

The C<$VERSION = eval $VERSION> idiom avoids some issues with it by
losing the underscore at runtime, but that might not be enough for
things that parse your distribution tarball version number and try to
do comparisons.

(see http://www.dagolden.com/index.php/369/version-numbers-should-be-boring/)

-- David

On Fri, Jul 27, 2012 at 3:48 PM, Jeffrey Thalhammer
Post by Jeffrey Thalhammer
I just discovered that version.pm always treats version numbers with an underscore as less than the equivalent version number without the underscore. So "6.63_02" is less than "6.6302". Is it it just me, or does that seem crazy? Dealing with $VERSION numbers in Perl is hard enough as it is. This doesn't help.
-Jeff
Michael G Schwern
2012-08-01 18:39:36 UTC
Permalink
Post by Jeffrey Thalhammer
I just discovered that version.pm always treats version numbers with an
underscore as less than the equivalent version number without the underscore.
So "6.63_02" is less than "6.6302". Is it it just me, or does that seem crazy?
Dealing with $VERSION numbers in Perl is hard enough as it is. This doesn't
help.

IMO it makes sense. 6.6302 and 6.63_02 are not the same thing. One is
stable, one is alpha. One is version 6.6302, one is 6.63 alpha 2. The alpha
version should always be less than an "equivalent" stable version.

What's really going on is this:

6.63_02 => 6.63_2
6.6302 => 6.6302.0

And 6.63 < 6.6302.

I know this gets in the way because people like to collapse alpha version
numbers to avoid a warning when they're compared as numbers. Ironically the
very thing people do which trips up version.pm is unnecessary with version.pm.
--
Life is like a sewer - what you get out of it depends on what you put into it.
- Tom Lehrer
Loading...