in reply to How to identify the package of a subroutine given only a reference to it
As side note to the main ansewer given by LanX++, and in the case you are the author of the subroutine, they obviously already know the package they belong to:
package XX; sub inxx{return __PACKAGE__} package main; my $ref = \&XX::inxx; print $ref->(); __END__ XX
L*
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to identify the package of a subroutine given only a reference to it
by drclaw (Acolyte) on Jan 31, 2022 at 22:56 UTC | |
by choroba (Cardinal) on Feb 01, 2022 at 00:11 UTC | |
by LanX (Saint) on Feb 01, 2022 at 02:32 UTC | |
by drclaw (Acolyte) on Feb 02, 2022 at 00:51 UTC | |
by LanX (Saint) on Feb 02, 2022 at 01:00 UTC | |
by drclaw (Acolyte) on Feb 02, 2022 at 22:56 UTC | |
|