in reply to How to identify the package of a subroutine given only a reference to it

> 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
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery

  • Comment on Re: How to identify the package of a subroutine given only a reference to it (Sub::Identify)
  • Download Code

Replies are listed 'Best First'.
Re^2: How to identify the package of a subroutine given only a reference to it (Sub::Identify)
by drclaw (Acolyte) on Jan 30, 2022 at 22:54 UTC
    Thank you for the quick reply! I'll check out your suggestions.