Subject: | Exporting subs to different package doesn't work |
..., in 01generic.t, perhaps:
{
package Foo;
use MyExport qw/askme $foo/;
Test::More::is($foo, $main::foo, "\$foo was exported to Foo"); # works
Test::More::is(eval { askme() }, main::askme(), "askme() was exported to Foo"); # doesn't work
}
If you turn on $Exporter::Verbose you'll see that Exporter is pushing stuff into main because the caller from the perspective of Exporter::Simple::INIT seems to be that.
I think this is unresolvable unless Attribute::Simple starts giving BEGIN attrs the name of the sub they acted on.