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

Re: [ #70622] Versions Disappear

David E. Wheeler
September 6, 2011 10:14
Re: [ #70622] Versions Disappear
Message ID:
On Sep 5, 2011, at 12:35 PM, David Golden wrote:

> Excerpt from <>:
>  $ perl5.8.8 -e '$VERSION=v120.100.103; print main->VERSION'
>  xdg
>  $ perl5.10.0 -e '$version=v120.100.103; print main->version'
>  v120.100.103

Gotta admit that the 5.10.0 behavior feels much saner to me.

>  [...]
>  $ 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, if 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 (prior to 0.92) is loaded by
> *any* module.

Yeah, that's clearly wrong. should not change global behavior like that. UNIVERSAL::VERSION should do its own thing IMNSHO.

> Sure, knowing all this, *you* could now choose to fetch $Foo::VERSION
> or Foo->VERSION, but prior to Perl 5.10.0, no one thought they did
> anything different, so I don't think it's a good idea to impose new
> semantics on old code simply for the convenience of today's coder, and
> certainly not without the deprecation cycle provided for in
> perlpolicy.
> I agree that it's a sorry state of affairs, but on this issue, I'm
> (perhaps shockingly?) in the do-no-harm backward compatibility camp.

But how much has it been complained about, really? I mean the change in behavior of UNIVERSAL::VERSION, not injecting global behavior, of course. It has been almost 3 years since 5.10.0 dropped.


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