Michael G Schwern wrote:
Could you elaborate? SVK uses this style to coordinate all its version numbers.

use SVK::Version; our $VERSION = $SVK::VERSION;

SVK::Version is nothing except a place to stick $SVK::VERSION. This avoids
having to load the main module (which loads tons of other stuff and can lead
to circularity) just to get the $VERSION.
But that only works when Perl is executing the module normally; you'll find that
every single subclass in SVK is listed on CPAN has having an undef version
(because CPAN's indexer runs each module in a safe compartment without access to
the SVK::Version class).

In a thread on M::B's discussion list, Adam K said:
Dynamic versions make toolchain maintainers cry.

It's evil, and no amount of trickery changes that.

It's also taint-unsafe and a potential security hole.
He wrote ppi_version (in PPI::PowerToys) to easily handle updating child modules
to keep up with a master $VERSION. Unfortunately, he hasn't released an update
with the patch I provided here:


to handle the rest of the common $VERSION assignment schemes.
There was the suggestion (I think from Tim Bunce) a long time ago to

$VERSION = "undef";

but it never took off. I still like it.
That would complicate version comparisons even more than they already are with
an extra filter for those undef strings.
Not an issue actually, if version.pm is involved (like in bleadperl). For this
express purpose, the following are equivalent for _comparison_ purposes:

$VERSION = "undef";
$VERSION = undef;


for details of why this became necessary.


John Peacock
Director of Information Research and Technology
Rowman & Littlefield Publishing Group
4501 Forbes Blvd
Suite H
Lanham, MD 20706
301-459-3366 x.5010
fax 301-429-5747

Search Discussions

Discussion Posts


Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 14 of 20 | next ›
Discussion Overview
groupperl5-porters @
postedJul 7, '07 at 9:06p
activeJul 8, '07 at 8:30p



site design / logo © 2019 Grokbase