On 10/27/05, Larry Wall <[EMAIL PROTECTED]> wrote:
> On Thu, Oct 27, 2005 at 05:37:13AM -0400, Rob Kinyon wrote:
> : Will I be able to do something like:
> :
> : package Foo;
> Hmm, you just started in Perl 5 mode.
> : $*VERSION = 1.3.2;
> Perl 5 would get confused here, so I'm presuming Perl 6.  But Perl 6
> isn't likely to let you override the global run-time Perl version.
> : use Foo-1.3.1;
> That I think I understand.
> : role My::Foo { does Foo; ... }
> Okay, My::Foo does Foo here.  Presumably it must "do" the Foo alias
> that the use just installed.  And presumably the Foo you just used
> is a role that can be "done".  Certainly you can't "do" the global
> package Foo, assuming that's what your original package declared.
> : alias My::Foo -> Foo; # Or whatever the syntax should be
> I have no clue where you're intending to install that alias.
> Are you trying to install a *Foo alias?  A bare Foo is going to first
> find the local alias to the Foo you used, and that hides the global
> Foo that it would have found otherwise.  I suspect you're trying to
> say
>     *Foo := My::Foo;
> : And, in my other code, "use Foo;" will DWIM?
> I don't know quite what you mean, so I don't know if it'll do what
> you mean.  If you're trying to establish a policy that defaults a
> particular name to a particular version, the library interface will
> probably give you a more straightforward way to set that up.

Sorry. I'm not up on the syntax. I should do some serious backlog reading.

What I'm trying to do is load role Foo 1.0, have My::Foo do Foo, then
call My::Foo version 2.0 of Foo so that anyone else in my program will
see My::Foo instead of the original Foo. Is this possible?


Reply via email to