http://qs1969.pair.com?node_id=419421

Ovid has asked for the wisdom of the Perl Monks concerning the following question:

I was going to release a module named "Aliased" which would alias long class names to short ones. However, it's only for OO modules , it sort of alters compile-time behavior so one might think of it as a pragma, and "class" is not a keyword. Thus, I could do this:

use class 'My::Company::Namespace::Customer'; use class 'My::Company::Namespace::Preferred::Customer', as => 'Prefer +red'; my $cust = Customer->new; my $pref = Preferred->new;

My immediate reaction was "no!", we don't want to do that. Then I realized I couldn't think of a reason why. Can you? I certainly don't want to release that and make people mad (though David Wheeler pointed out that "class" doesn't indicate that anything's getting exported to the current namespace).

Side note: the "as" key in the import list is important because there's a separate "import" key in case you need to pass args to the module's import() method.

X-posted to my use.perl journal and to the module authors mailing list.

Cheers,
Ovid

New address of my CGI Course.