Keep It Simple, Stupid | |
PerlMonks |
Re: How to identify the package of a subroutine given only a reference to it (Sub::Identify)by LanX (Saint) |
on Jan 30, 2022 at 12:36 UTC ( [id://11140964]=note: print w/replies, xml ) | Need Help?? |
> find out the package a subroutine belongs to If you mean the package/stash were it was originally defined in: Yes. It's kept as special field inside the internal data. There is a way to inspect this w/o dependencies using B Otherwise there are various modules on CPAN doing that°.
edit°) see stash_name in
Cheers Rolf
In Section
Seekers of Perl Wisdom
|
|