On Fri, Jun 20, 2008 at 04:19:41PM +0100, Fergal Daly wrote:
> To be a little more constructive. Here's something that is
> implementable and I think reasonable.
>
> use Foo::Bar;
>
> 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" }
hdp.