On Fri Sep 13 16:35:14 2013, DJERIUS wrote:
Show quoted text> On Mon Sep 10 05:34:06 2012, TOBYINK wrote:
> > Here's a slightly hackish workaround:
> >
> > ```
> > {
> > package Foo;
> > use namespace::sweep;
> > sub import {
> > require Exporter::Tidy;
> > Exporter::Tidy->import(
> > default => [qw( $foo )]
> > );
> > goto \&import;
> > }
> > our $foo = 1;
> > BEGIN { $INC{'Foo.pm'}=1 }
> > }
> > package Bar;
> > use Foo;
> > print "foo=$foo\n";
> > ```
> >
> > And another slightly less hackish...
> >
> > ```
> > {
> > package Foo;
> > use namespace::sweep;
> > use Exporter::Tidy
> > default => [qw( $foo )];
> > our $foo = 1;
> > BEGIN {
> > $INC{'Foo.pm'} = 1;
> > require Sub::Name;
> > Sub::Name::subname('Foo::import', \&Foo::import);
> > }
> > }
> > package Bar;
> > use Foo;
> > print "foo=$foo\n";
> > ```
>
>
> Would this not also work (it seems to for me, but perhaps I'm missing
> something)? It seems a bit simpler.
>
> use Exporter();
> sub import { goto \&Exporter::import }
AARgh. and that's what you said, already, but with slightly different words. Please disregard...