Pathologically Eclectic Rubbish Lister | |
PerlMonks |
Re^2: How to identify the package of a subroutine given only a reference to itby drclaw (Acolyte) |
on Jan 31, 2022 at 22:56 UTC ( [id://11141003]=note: print w/replies, xml ) | Need Help?? |
Hi, Yes, it is a subroutine I generate through an eval, in a custom package I was toying with the idea that I could track the package with only the ref to the generated subroutine. However, I need to do package housekeeping when the sub is no longer required. So now have an object which contains the package name and the generated subroutine. The package name obtained using the __PACKAGE__ like you mentioned. Thanks for the welcome!
In Section
Seekers of Perl Wisdom
|
|