in reply to
Re: Re: use Very::Long::Module::Name as Foo;
in thread use Very::Long::Module::Name as Foo;
Your opinions on what is and is not obvious clearly differ from mine. And breaking out the 50 pound sledgehammer of source filters, along with all of TheDamian's heuristics about how to interpret what is valid Perl (which you are quickly obsoleting), along with the potential bugs when TheDamian gets it wrong, doesn't strike me as a conceptually lightweight approach. Even when the piece that you added is simple.
Now Very::Long::Module::Name as Foo;
[download]
BEGIN {*{"Foo::"} = \*{"Very::Long::Module::Name::"}}use Very::Long::M
+odule::Name;
[download]
So this is before anything is required under "use"s hood.
Liz
No. That was the point of the string eval.
I guess we agree to disagree. I find the syntax of
Very::Long::Module->load::as my $short => qw(foo bar baz);
[download]
...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:
use Foo;
use Bar;
[download]
package Foo;
use Very::Long::Module::Name as Shorty;
[download]
package Bar;
use Some::Other::Long::Module::Name as Shorty;
[download]
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... ;-)