develooper Front page | perl.perl5.porters | Postings from September 2011

Re: [rt.cpan.org #70622] Versions Disappear

Thread Previous | Thread Next
From:
John Peacock
Date:
September 7, 2011 03:57
Subject:
Re: [rt.cpan.org #70622] Versions Disappear
Message ID:
4E674E0A.4020107@havurah-software.org
On 09/06/2011 01:14 PM, David E. Wheeler wrote:
>>   [...]
>>
>>   $ perl5.8.8 -Mversion -e '$VERSION=v120.100.103; print main->VERSION'
>>   v120.100.103
>>
>>   Think about the implications of that for a module called 'Foo'. Even if
>>   Foo doesn't use version.pm, if version.pm is loaded anywhere then
>>   Foo->VERSION acts differently and gives a different value than is in
>>   $Foo::VERSION.
>>
>> *Any* code written expecting the 5.8.8 behavior of ->VERSION breaks in
>> 5.10.0 or even in 5.8.8 if version.pm (prior to 0.92) is loaded by
>> *any* module.
>
> Yeah, that's clearly wrong. version.pm should not change global behavior like that. UNIVERSAL::VERSION should do its own thing IMNSHO.

version.pm is a pseudo-pragma.  The whole point of the CPAN release was 
to make _any_ Perl act the same way regarding version comparisons. 
There is no way to make that happen without having a version-object 
aware UNIVERSAL::VERSION, which is why version.pm has exactly the same 
code as exists in the Perl core...

John

Thread Previous | Thread Next


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