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

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

From:
David Golden
Date:
September 5, 2011 12:35
Subject:
Re: [rt.cpan.org #70622] Versions Disappear
Message ID:
CAOeq1c_umyDKivVceqJgqNec=1HpvCdqTmoCQSYaK2cnqCfQ4g@mail.gmail.com
On Mon, Sep 5, 2011 at 2:44 PM, David E. Wheeler <david@kineticode.com> 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 <http://www.dagolden.com/index.php/369/version-numbers-should-be-boring/>:

  $ 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

  [...]

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

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.

-- David



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