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

Re: [ #70622] Versions Disappear

David Golden
September 5, 2011 12:35
Re: [ #70622] Versions Disappear
Message ID:
On Mon, Sep 5, 2011 at 2:44 PM, David E. Wheeler <> wrote:
>> Version objects are far more useful to others who consume $VERSION,
>> but module authors may reasonable expect $VERSION not to be modified
>> from outside their own code.  That was the crux of my argument and
>> I'll stick with it, annoyances as you cite to the contrary.
> It seems to me that if you want the original $VERSION, you fetch $Foo::VERSION. Foo->VERSION can meanwhile return a VERSION object. Used to be you could get one or the other, but now you get the same thing from both sources. I find that annoying and, frankly, less useful.

Excerpt from <>:

  $ perl5.8.8 -e '$VERSION=v120.100.103; print main->VERSION'

  $ perl5.10.0 -e '$version=v120.100.103; print main->version'


  $ perl5.8.8 -Mversion -e '$VERSION=v120.100.103; print main->VERSION'

  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

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

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

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.

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