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

Perfect, so long as it is indeed called $self.. :)

Makeshifts last the longest.

  • Comment on Re^3: How can I find the calling object?

Replies are listed 'Best First'.
Re: Re^3: How can I find the calling object?
by strider corinth (Friar) on Nov 18, 2002 at 18:09 UTC
    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.
      Only if that limitation shows up in the BUGS or CAVEATS section of your POD.

      Makeshifts last the longest.

      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.