--- Hans Dieter Pearcey <[EMAIL PROTECTED]> wrote:

> > never does anything to the importing package
> > 
> > use Foo::Bar as => Bar;
> > 
> > plops a constant function Bar into your package. The constant is an
> > object on which you can do
> > 
> > Bar->some_function(@args)
> > 
> > and it is the equivalent of calling
> > 
> > Foo::Bar::some_function(@args)
> 
> In my TODO is an entry for implementing this for Sub::Exporter.
> 
> You don't even need to use AUTOLOAD:
> 
> * create Some::Long::Generated::Package
> * import symbols from Foo::Bar into SLGP, wrapping each with
>   sub { shift; $original_code->(@_) }
> * export Bar() into the calling package
>   sub Bar () { "Some::Long::Generated::Package" }

This is sort of on the CPAN now.

  use aliased 'Some::Long::Module::Name::For::Customer';
  my $customer = Customer->new;

It's moderately popular and people are quite happy with it (at least
from the feedback I've gotten).  Though I'm rather interested in this
take on the idea.

Cheers,
Ovid

--
Buy the book         - http://www.oreilly.com/catalog/perlhks/
Personal blog        - http://publius-ovidius.livejournal.com/
Tech blog            - http://use.perl.org/~Ovid/journal/
Official Perl 6 Wiki - http://www.perlfoundation.org/perl6 
Official Parrot Wiki - http://www.perlfoundation.org/parrot

Reply via email to