in reply to localizing __PACKAGE__?
The better solution would be to be clear when you invoke foo() as to which hello(0) you want it to call. If, instead of passing the anonymous sub to foo(), you were to attempt to invoke hello(), it would fail because there is no hello(). What makes you think it should work any better inside foo()?
foo(sub { other::hello() } );
As Occam said: Entia non sunt multiplicanda praeter necessitatem.
|
|---|