develooper Front page | perl.perl5.porters | Postings from January 2005

Re: [Module::Build] Re: [perl #33927] [BUG] Coredump in 5.9.2 whenevalling a certain string while in a coderf in @INC

Thread Previous
From:
John Peacock
Date:
January 26, 2005 06:42
Subject:
Re: [Module::Build] Re: [perl #33927] [BUG] Coredump in 5.9.2 whenevalling a certain string while in a coderf in @INC
Message ID:
41F7AC7A.5020101@rowman.com
David A. Golden wrote:

> I asked a question about the latest thinking on version numbers in 
> modules on perlmonks and got a tremendously wide range of answers -- and 
> certainly no consensus that all modules need a VERSION.  In fact, 
> several people went the opposite route, leaving just a single VERSION 
> for the master module so that the distribution version is built 
> correctly and leaving all other modules VERSION-less.
> 
>     http://perlmonks.org/index.pl?node_id=417576

I'm sorry that I don't have as much time to attend to perlmonks as I 
should.  I'll try and spend some time reading and then commenting on 
that thread; for better or worse, I am the $VERSION expert, having spent 
nearly two years in the core detangling the web of inconsistencies. ;(

However let me rephrase my original statement:

All modules _in the core_ must have a $VERSION number, even if it is 
just a reference to some other module's $VERSION (this is not the best 
but it is better than naught).  The reason for this is that once modules 
are in the core, they can get individually modified and their parent 
module might not change (or even be updated timely on CPAN for dual-life 
modules).  Without a $VERSION in all modules in the core, the odds of 
changes being missed are high and for dual-lifed modules the odds of 
desynchronization between core and CPAN is very high.  A couple of years 
ago, someone went through and added $VERSION's to all core modules; I 
suppose I should check to make sure that is still the case...

At the same time, any module which is released to CPAN _should_ have a 
$VERSION, even if it is basically a private module of some other module. 
  The reason flows out of the above paragraph - if the module would ever 
be considered for the core, it needs a $VERSION.  A package scalar is 
cheap (in the larger picture of the overhead Perl requires).  If you 
would ever want to spin off a given sub-module into it's own 
distribution, it will have to have a $VERSION, so you might as well give 
it one now, rather than waiting until later.

That being said, if you are writing modules for your own use, and you 
don't intend to release it into the public, there is no reason for 
$VERSION at all.  It is strictly there to facilitate good inter-module 
dependencies.

> 
> CPAN seems not to care if there's a version -- pulling from the suffix 
> on the distribution tarfile, right (or maybe using a META file)?  

Actually from the Makefile.PL; if that refers to a module name, then 
that file is parsed to get the $VERSION, else that number is used as the 
CPAN version.

> The suggestion that M::B::Base simply define version seems like an easy 
> solution.  It doesn't even need to be $VERSION=$Module::Build::VERSION 
> -- it could be anything so long as it's early enough in the file that 
> other tools find it and stop searching.

I agree that this would fix this immediate problem, but not the deeper 
issue that M::B::Base is trying to ignore version.pm magic, which isn't 
possible in bleadperl (since that is all there is there).

John

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

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About