http://qs321.pair.com?node_id=11138950


in reply to Changing the name of a function in the call stack

See for example Sub::Name.

I thought there was a special variable to set the name of the current subroutine, but I don't find it. So Sub::Name is the most likely candidate here.

  • Comment on Re: Changing the name of a function in the call stack

Replies are listed 'Best First'.
Re^2: Changing the name of a function in the call stack
by kikuchiyo (Hermit) on Nov 19, 2021 at 18:13 UTC

    Excellent, thanks!

    (I looked at the XS source of that module - wow, that looks extremely complicated.)

      Also have a look at Sub::Util (set_subname()) which is included with Perl since v5.21.4.

      A new module, Sub::Util, has been added, containing functions related to CODE refs, including subname (inspired by Sub::Identity) and set_subname (copied and renamed from Sub::Name). …