in reply to Re: Re:(4): •Re: Upgrade B::Deparse?
in thread Upgrade B::Deparse?

I don't think it's impossible. I just think there are probably a lot of little issues to get it to work in the genreral case so that you don't even have to think about it, it just works. I've done similar things with PadWalker but they wouldn't work in all cases and the subs had functions that had to be explicitly called to restore state.

One point about using a hash for the references, no matter what you use they end up being strings from my understanding as they are automatically quoted.

-Lee

"To be civilized is to deny one's nature."
  • Comment on Re: Re: Re:(4): •Re: Upgrade B::Deparse?

Replies are listed 'Best First'.
Re: Re: Re: Re:(4): •Re: Upgrade B::Deparse?
by diotalevi (Canon) on Oct 04, 2002 at 13:20 UTC

    You are misunderstanding me about the hash but that's ok since I'll take your word for it that there are many tricky little things that just aren't visible to me right now. All I meant by the hash was so that you could compare the addresses of two variables to see if it was the same one being referred to twice. Anyhow... I suppose I'll drop it unless I feel like just patching B::Deparse myself.

    __SIG__
    printf "You are here %08x\n", unpack "L!", unpack "P4", pack "L!", B::svref_2object(sub{})->OUTSIDE

      Regarding the hash references..
      "Actually I would numify the reference since it's cheaper but that's not the point."

      I took this to mean that you would be comparing references (numbers) instead of strings. If you use a hash for a key for remembering what data you have processed, then the key gets stringified, what I wasn't thinking was that the values of the keys wouldn't be stringified and that's what you would be comparing. slaps($self).

      As far as taking my word on the diffculties, don't take my word for anything. I don't know enough about internals but I think if it was that easy we would have had it a long time ago. Personally I'd like to see it. Very handy. One of the reasons I am trying to get into internals is to figure out how to implement coroutines and such. Haven't had that much time to devout so far and for me it's taking awhile. So many macros!

      -Lee

      "To be civilized is to deny one's nature."