8 my $foo_stash = Package::Stash->new('Foo');
9 $foo_stash->add_package_symbol('&foo' => sub { caller(0) });
10 is((Foo::foo())[3], 'main::__ANON__', "no subname if not requested");
12 $foo_stash->add_package_symbol('&bar' => sub { caller(0) }, subname => 'bar');
13 is((Foo::bar())[3], 'Foo::bar', "got the right subname with implicit package");
15 $foo_stash->add_package_symbol('&baz' => sub { caller(0) }, subname => 'BAZ');
16 is((Foo::baz())[3], 'Foo::BAZ', "got the right subname with implicit package and different glob name");
18 $foo_stash->add_package_symbol('&quux' => sub { caller(0) }, subname => 'Bar::quux');
19 is((Foo::quux())[3], 'Bar::quux', "got the right subname with explicit package");