in reply to Re: Re^2: How can I find the calling object? in thread How can I find the calling object?
Well, the two DB related answers are close, but one constrains me to name my object (or an intermediate object) DB, and the other doesn't. That makes them very different for my use. As for PadWalker, I don't think it uses caller() or DB at all. Most of its work is done in XS, if I recall.
--
Love justice; desire mercy.
Re: Re^4: How can I find the calling object?
by demerphq (Chancellor) on Nov 20, 2002 at 16:31 UTC
|
Oh. Maybe im confused here. I thought that PadWalker wasn't suitable since @_ isnt a lexical. Maybe i havent read this thread closely enough (probably). And since I assumed that the PadWalker bit wasnt suitable it seemed likely you mean the caller() solution.
As for the differences between the caller() implementation they are basically trivial. They all use the idea of using caller inside of the package DB. I lexically scope that package declaration, the other idea adds a subroutine to the DB namespace to make it "easier". Personally I like mine more... But im clearly biased. :-)
BTW if you want a good snippet for seeing how to use caller like this (the one i learned all this from) have a look in Carp::Heavy
Good luck.
--- demerphq
my friends call me, usually because I'm late....
| [reply] [Watch: Dir/Any] |
|