worst perl best practices

rjbs on 2005-09-26T17:26:01

There are a few things I disagree with in PBP, but I'm just going to name the one that is current causing me the most inconvenience because I can't just ignore the rule.

Damian says, "use three-part version numbers."

No. Do not do this, at least not if you're going to use version.pm.

Because Damian is using "qv(0.99.2)" and the like, the CPAN indexer considers the version number in IO/Prompt.pm to be undef, so it is not newer than the one that had "$VERSION = '0.02'" and so the new version isn't installed when I run "cpanp install IO::Prompt"

Maybe the indexer should be fixed, but in the meantime, do not do what Damian does.


Class::DBI has a solution

Dom2 on 2005-09-26T18:09:06

You could always do what Class::DBI does:
use version; $VERSION = qv('3.0.8');

This is slightly ugly, but will work.

-Dom

Re:Class::DBI has a solution

jk2addict on 2005-09-26T18:55:17

Actually, it doesn't. I believe Matt Trout was cursing the virtues of the 3 part number when CPAN/CPANPLUS read the one of the package gz files and the three part versions were listed as 3.0; making upgrading to a newer verison broken.

Ahh...here.. ftp://ftp.cpan.org/pub/CPAN/modules/02packages.details.txt.gz
Class::DBI                          3.0  T/TM/TMTM/Class-DBI-3.0.1.tar.gz
That's from the current file:
09/26/05 07:14AM        393,184 02packages.details.txt.gz

CPAN Indexer

kane on 2005-09-27T07:44:56

The 'old' CPAN indexer treated a version number like x.y.z as x.y, effectively chopping off the 'z'... so z and z+1 or for that matter z-1 all ended up as the same version in the indexes, and would be perpetually marked as 'up to date' until the minor version (y) got upped.

Andreas is working on a change to the indexer that will use version.pm to translate x.y.z to a float that can be , but it's not there yet. Until then, I agree with the poster -- do not use x.y.z versions unless you *absolutely* must, and be aware of the consequences if you do.