in reply to localizing __PACKAGE__?
You may want to do something like:
orfoo(sub {package other; hello()}); # Always calls other::hello
sub foo {package other; $_[0]->()} foo(sub {no strict 'refs'; &{(caller)[0] . "::hello"}()}); # Always ca +ll hello in callers namespace.
|
|---|