base.pm no longer modifies $VERSION
authorDavid Golden <dagolden@cpan.org>
Thu, 22 Sep 2011 15:09:33 +0000 (11:09 -0400)
committerDavid Golden <dagolden@cpan.org>
Thu, 22 Sep 2011 15:19:43 +0000 (11:19 -0400)
commita04eb69c733e84250299f12df200f10b76b0a45c
tree6a53c44b2b82f3e145a4bcd60c90726be9cc15c9
parent3abacf659103620efac9195fd5412a4c8dbe3b87
base.pm no longer modifies $VERSION

Previously, base.pm modified the $VERSION of modules it loaded to
the string "-1, set by base.pm".  This is not a valid lax version
string and thus could not be parsed by version.pm. (It is also an
encapsulation violation, as it modifies a global in another package.)

This patch removes the $VERSION modification code entirely and uses
a private hash to track which modules base.pm has successfully loaded.
This also eliminates a subtle bug in how base.pm was checking for
the existence of a package's VERSION scalar.

[Though the final mechanism is different, thank you to John Peacock for
proposing the initial patch to eliminate the "-1..." code from base.pm]
dist/base/lib/base.pm
dist/base/t/base.t