On Sun, Sep 13, 2009 at 4:25 PM, Jerry D. Hedden <[email protected]> wrote:
>> I use the three number form:
>>   $VERSION = q(v1.2.3);
>
> This may cause problems because it makes $VERSION a string,
> namely, "v1.2.3".  This prohibits numeric version comparisons
> which is the norm.

The quoting definitely will cause some issues.

v-strings by themselves ($VERSION = v1.2.3) generally will work OK, *except*:

* Parts of the toolchain (e.g. ExtUtils::MakeMaker) can't deal with
v-strings in PREREQ_PM.

* Foo->VERSION will return different things depending on the version
of perl and whether version.pm was loaded (by *any* module anywhere in
the process).

* Never use "alpha" v-strings, e.g.  v1.2_4.  How that behaves is
radically different on older versions of perl.

* If users say "use Foo 1.002003" because they are used to specifying
"use 5.006002" for perl 5.6.2, this could fail on perl's compiled for
long doubles with the bizarre error: "Foo version 1.002003
required--this is only version 1.002003"

> It also means your CPAN modules will get
> called something like Mod-Name-v1.2.3.tar.gz which is also
> non-standard.

It's no longer non-standard, at least as far as PAUSE and the
toolchain are concerned.  In fact, it's likely to become "standard",
following the convention that all dotted-integer versions should be
expressed in "normal" form with the leading "v".

I still recommend decimal $VERSION numbers, with eval afterwards to
clean up alpha version.

Gory $VERSION details here:
http://www.dagolden.com/index.php/369/version-numbers-should-be-boring/

-- David

Reply via email to