in reply to Good way of getting subroutine name from ref?

A quick search on "subroutine name" gave the following results: Anyways, the answer is $name = (caller(0))[3]. See caller for details.
Cheers,
CombatSquirrel.
Entropy is the tendency of everything going to hell.

Replies are listed 'Best First'.
Re: Re: Good way of getting subroutine name from ref?
by Anonymous Monk on Dec 05, 2003 at 21:55 UTC
    But I want to get the name of the ref without actually calling it. Caller only works if the function you're inquiring about is in the stack frame somewhere.

    diotalevi's technique looks like it will work, but wow, that's some deep magic. :)

      Oops, seems that I haven't read the important part of the question. Sorry.
      CombatSquirrel.
      Entropy is the tendency of everything going to hell.