in reply to Re^2: Is there a way to access the name under which a subroutine was first defined?
in thread Is there a way to access the name under which a subroutine was first defined?
It definitely does seems to be a compilation stage issue. My new toy Devel::Peek::Dump(...) also reports the subroutine name correctly if it is called after the sub is compiled, but not when the subroutine's attributes are being processed via MODIFY_CODE_ATTRIBUTES.
That's not a phase issue. Keep in mind that MODIFY_CODE_ATTRIBUTES actually wraps the subroutine into another one, by saving the reference from the typeglob and assigning the reference of the new (outer) subroutine to it: the subroutine reference *foo{CODE} is necessarily changed. Update: well, the contents of that. But the address in the typeglob remains the same, it seems... hmm.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Is there a way to access the name under which a subroutine was first defined?
by ELISHEVA (Prior) on Feb 16, 2009 at 11:13 UTC | |
by shmem (Chancellor) on Feb 16, 2009 at 13:31 UTC | |
by ELISHEVA (Prior) on Feb 16, 2009 at 14:20 UTC |