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

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

From:
Nicholas Clark
Date:
September 7, 2011 04:05
Subject:
Re: [rt.cpan.org #70622] Versions Disappear
Message ID:
20110907110531.GI23881@plum.flirble.org
On Wed, Sep 07, 2011 at 06:57:14AM -0400, John Peacock wrote:
> On 09/06/2011 01:14 PM, David E. Wheeler wrote:

> >> *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...

Yes, this is accurate, but missing the complaint:

A *different* version of the Perl core.

The CPAN release contains the current Perl core semantics. That's good.

But what this means is that on any *previous* major release, any module
can load version.pm and as a side effect change core semantics everywhere.
Effectively, loading version.pm behaves like upgrading perl to a different
major version. At runtime. From any module's code.


I don't have a solution to that. But that's the concern. Legitimate in my
opinion.

Nicholas Clark



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