in reply to Reference to an anon sub from within.

I believe that this is only possible if you either set up the binding in advance, or if you use XS to poke around in Perl's internals. If you wanted to use XS, though, you could easily create a function that acts a lot like caller except that it is more informative.

If you want somewhere to start on trying to write that, you could take a look at the implementation of Want.

  • Comment on Re: Reference to an anon sub from within.

Replies are listed 'Best First'.
Re^2: Reference to an anon sub from within.
by gaal (Parson) on Mar 09, 2005 at 06:12 UTC
    Alternatively, for an example of code that does bind in advance but is thus pure Perl, see Class::Rebless.