Beefy Boxes and Bandwidth Generously Provided by pair Networks
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??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11140964]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (2)
As of 2024-04-24 23:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found