Oops, Luke Palmer alerted me to the fact that I screwed up in the below.

In a message dated Tue, 22 Aug 2006, Trey Harris writes:
My question is, if a program is running where two versions of Dog are loaded, say 1.3.4 and 2.1, and a file contains:

 use Dog-1.3.4-cpan:JRANDOM;

 class Poodle is Dog {

will the compiler know that 'Dog' in this file must always refer to 1.3.4, and not 2.1, as most other references to the shortname would? If not, sites that need dependency stability will have to write

I misstated my worry here. In this case, by the same rule that "my Dog $foo" gets the right version because the longname is aliased to the shortname in the lexical scope of the use, it would work.

What I'm actually concerned about is the case where the Dog CPAN distribution includes Poodle.pm. I think that we need Poodle.pm to be written like:

  use Dog-1.3.4-cpan:JRANDOM;
  class Poodle-1.3.4-cpan:JRANDOM is Dog { ... }

If it's written:
  use Dog;
  class Poodle-1.3.4-cpan:JRANDOM is Dog { ... }

then in a running Perl program that has previously loaded Dog-2.1-*, Poodle-1.3.4 will become a subclass of Dog-2.1, which causes any code using Poodle-1.3.4 to be unable to protect itself from an unforseen upstream dependency change.

Such wordiness seems unfortunate and error-prone. I don't believe the specs yet have anything to say about how filesystem layout exists in the world of versioned packages, but it would be nice if a distribution's packages can use a shortname and automatically refer to other packages in the same distribution before the compiler looks elsewhere within %*INC (or its moral equivalent).


Reply via email to