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

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

Thread Previous | Thread Next
Jos I. Boumans
January 27, 2005 01:56
Re: [Module::Build] Re: [perl #33927] [BUG] Coredump in 5.9.2 when evalling a certain string while in a coderf in @INC
Message ID:

On Jan 26, 2005, at 9:00 PM, Ken Williams wrote:

> On Jan 25, 2005, at 3:26 PM, John Peacock wrote:
>> Jos I. Boumans wrote:
>>> I suppose if Module::Build::Base would say, at the top:
>>>     $VERSION = $Module::Build::VERSION
>>> this would make EU::MM, M::IV, M::L::C and of course CPANPLUS::inc 
>>> find a 'real' version declaration, rather than something evil that 
>>> will blow away UNIVERSAL::VERSION.
>> Yes, that would be an appropriate fix to M::B::Base.
> That won't work.  All those tools evaluate the version line in 
> isolation, not by loading the modules and checking the value of 
> $VERSION.  In other words, when Module::Build::Base's version is 
> checked, Module::Build won't be loaded, so the version would be undef.

Well, the above one line fix adresses 2 issues, and they both 'do work':
	1)	Under normal operation, M::B::Base is loaded from M::B, so 
the		$VERSION variable would be defined. Anyone using M::B 
		would find what is expected.
	2)	All tools using the EU::MM 'standard' regex would find a valid 
		declaration. One that does not happen to override *UNIVERSAL::VERSION
		when being evaluated in the way they have been for quite some time 

So even though in scenario 2 we will not always get a real version 
number (it
would only when M::B was, for some reason, already loaded), it has the 
benefit of Doing The Right Thing when being inspected by tools that 
look for
$VERSION declarations, rather than override built-in methods.
Also, it conforms to the generally accepted view that 'everything 
should have a
version number, even if inherited'.

If nothing else, such an addition wouldn't /hurt/ anything now, and 
would stop
segfaults in bleadperl for the moment (of course, they'd need to be 
fixed proper anyway).

my $0.02;

	Jos Boumans

	"Time is nature's way of making sure all the sh*t doesn't happen
	at once"


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About