I guess we agree to disagree. I find the syntax of
very confusing. And a strange, roundabout way of setting $short.Very::Long::Module->load::as my $short => qw(foo bar baz);
...without trampling on any potential global namespace...
I think you touch on a very important flaw of my "as.pm" and of Package::Alias' approach as well. Consider a program which has:
Now, Foo.pm has the following shortening (using my syntax for ease of reading):use Foo; use Bar;
and Bar.pm has the following shortening:package Foo; use Very::Long::Module::Name as Shorty;
Then you see we have a problem. One of the two modules will be referring to the wrong long module name, depending on whether an existing stash would be overwritten or not. In other words: you can only have one Shorty. That's because the stash aliasing (or the @ISA assignment) is not limited to the package scope from which it is invoked. And I don't see a way to encapsulate it, as all of the object creation is at run-time.package Bar; use Some::Other::Long::Module::Name as Shorty;
In my view, this pulls the rug from under any shortening approach currently available. As you cannot create code that can be well-behaved in that respect.
Too bad. It was a nice idea while it lasted... ;-)
Liz
In reply to Re: Re: Re: Re: use Very::Long::Module::Name as Foo;
by liz
in thread use Very::Long::Module::Name as Foo;
by liz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |