Subject: | Can't take reference to exported subroutine |
This may be related to the previous bug, I don't know.
Consider:
$ cat Foo.pm
package Foo;
use base 'Exporter::Simple';
sub foo : Exportable {
print "foo: @_\n";
}
1;
$ cat Bar.pm
package Bar;
use Foo 'foo';
sub bar {
my $cref = \&foo;
$cref->( 42 );
}
1;
$ perl -MBar -e 'Bar->bar'
Undefined subroutine &Bar::foo called at Bar.pm line 9.
But it's okay when called from the main program and not a module:
$ perl -MFoo=foo -e '$cref=\&foo; $cref->(42)'
foo: 42