in reply to Re^3: How can I find the calling object?
in thread How can I find the calling object?

Hehe. Fair 'enough. But that can be ascertained without even looking at the original code, so I don't worry about it. ;) You're right, though, in that it can't be 100% generalized. I'd say this is still a Right Way To Do It.
--
Love justice; desire mercy.
  • Comment on Re: Re^3: How can I find the calling object?

Replies are listed 'Best First'.
Re^5: How can I find the calling object?
by Aristotle (Chancellor) on Nov 18, 2002 at 18:30 UTC
    Only if that limitation shows up in the BUGS or CAVEATS section of your POD.

    Makeshifts last the longest.

Re: Re: Re^3: How can I find the calling object?
by John M. Dlugosz (Monsignor) on Nov 18, 2002 at 19:15 UTC
    You might look at $_[0] instead of $self, but that doesn't work if it's been shifted. Maybe it's called $this.
      Tried it. @_ isn't a lexical variable, at least as far as PadWalker's concerned. Only if you actually assign a value from @_ to some other variable does it become available. Good idea, though. =)
      --
      Love justice; desire mercy.
        Perhaps the caller DB trick is best, then, since it is reported to give the "original" parameters to the function. Then it doesn't matter what the function named it locally, or shifted it off or not.