Empirically, lots of modules don't put the version number in every .pm
file. If you do a snapshot bundle (b
in cpanp
) and look at the generated file, you'll see that. On my machine, the snapshot for Perl 5.16.2 with lots of modules added contained 7962 modules, but 2070 of those included 'undef' as the version (so roughly 1 in 4 has undef as the version).
Personally, I don't like that, so all the .pm
files in my module — DBD::Informix — are version stamped with the same version in each release (the current release is 2013.0118, and all the .pm
files are stamped with 2013.0118 as the version number), but there are lots of modules (people) that do it otherwise.
- You do not have to provide a version number for every
.pm
file.
- On the whole, it is better if you do in fact provide a version number for every
.pm
file.
- I think it is sensible to provide the same version number for all
.pm
files in a distribution.
In my view, the worst problems come when a module is updated but some bit isn't, so CPANPLUS thinks the module is out of date even though installing the latest version doesn't change anything. I've got 5 modules like that at the moment, and I'm sorely tempted to delete them all, especially since I'm not really using them. (Sometimes, that's triggered by a file being installed in a new location, but I don't think that's the only cause. I'm not sure what else triggers it, but it is a problem that occurs periodically.)