3 BEGIN { print "1..5\n"; }
8 my $x = subname foo => sub { (caller 0)[3] };
9 print $x->() eq "main::foo" ? "ok 1\n" : "not ok 1\n";
17 print $x->() eq "Blork:: Bar!" ? "ok 2\n" : "not ok 2\n";
19 subname "Foo::Bar::Baz", $x;
20 print $x->() eq "Foo::Bar::Baz" ? "ok 3\n" : "not ok 3\n";
22 subname "subname (dynamic $_)", \&subname for 1 .. 3;
25 subname "Dynamic $_", $x;
26 print $x->() eq "Blork::Dynamic $_" ? "ok $_\n" : "not ok $_\n";