- use subs::auto in => 'subs::auto::Test::Pkg';
-
- eval { subs::auto::Test::Pkg::foo 1 };
- is($@, '', 'compiled to subs::auto::Test::Pkg::foo(1)');
- is($foo, 3, 'subs::auto::Test::Pkg::foo was really called');
-
- {
- use subs::auto;
-
- eval { foo 2 };
- is($@, '', 'compiled to foo(2)');
- is($foo, 4, 'main::foo was really called');
+ eval q{
+ use subs::auto in => 'subs::auto::Test::Pkg';
+ subs::auto::Test::Pkg::foo 1
+ };
+ my $err = $@;
+ is($err, '', 'compiled to subs::auto::Test::Pkg::foo(1)');
+ is($foo, 3, 'subs::auto::Test::Pkg::foo was really called');
+}