in reply to Re: What package is foo() from?
in thread What package is foo() from?

caller knows the package name (show below) at run-time. Is there a way (B:: modules?) to extract it without calling the function?

require Carp; { package TestA; sub testing { TestC::testing(); } } { package TestB; sub testing { TestD::testing(); } } { package TestC; *testing = \&TestB::testing; } { package TestD; sub testing { print(Carp::confess("Confessing")); } } TestA::testing(); __END__ Confessing at !.pl line 20 TestD::testing() called at !.pl line 10 TestB::testing() called at !.pl line 5 <-- We called TestC: +:testing TestA::testing() called at !.pl line 23