C<< in => $pkg >>
-Specifies on which package the pragma should act. Defaults to the current package.
+Specifies on which package the pragma should act. Setting C<$pkg> to C<Some::Package> allows you to resolve all functions name of the type C<Some::Package::func ...> in the current scope. You can use the pragma several times with different package names to allow resolution of all the corresponding barewords. Defaults to the current package.
=back
use strict;
use warnings;
-use Test::More tests => 12;
+use Test::More tests => 16;
our $foo;
is($@, '', 'compiled to foo(3)');
is($foo, 3, 'main::foo was really called');
+ eval { subs::auto::Test::Pkg::foo 4 };
+ is($@, '', 'compiled to subs::auto::Test::Pkg::foo(4)');
+ is($foo, 8, 'subs::auto::Test::Pkg::foo was really called');
+
{
package subs::auto::Test::Pkg;
}
}
+{
+ package subs::auto::Test::Pkg;
+
+ use subs::auto;
+
+ eval { foo 8 };
+ Test::More::is($@, '', 'compiled to foo(8)');
+ Test::More::is($foo, 16, 'subs::auto::Test::Pkg::foo was really called');
+}
+
{
use subs::auto in => '::';