in reply to Re^3: Dumping variables but DRY and simple
in thread Dumping variables but DRY and simple

> To get to the real name, you would have to fiddle with the compiler.

Sorry IMHO that's wrong, I can get the realname for my and our declarations with the help of PadWalker which is core!

And even without strictures I can still search through the symbol tabel of the caller's package.

(which might produce multiple results)

Cheers Rolf

Replies are listed 'Best First'.
Re^5: Dumping variables but DRY and simple
by ikegami (Patriarch) on Mar 27, 2010 at 16:06 UTC
    PadWalker inspects the opcode tree, which what I think rovf meant.
Re^5: Dumping variables but DRY and simple
by rovf (Priest) on Mar 27, 2010 at 16:09 UTC
    Sorry IMHO that's wrong, I can get the realname for my and our declarations with the help of PadWalker which is core!

    I think PadWalker *does* interfere with the compiler (otherwise I don't see how it could get the names of the lexicals). Since when is it in Core? I can't see it in Perl 5.10.0 (in the ActiveState distribution).

    -- 
    Ronald Fischer <ynnor@mm.st>
      I haven't looked at the code recently, but I don't think so. The name of a lexical IS available.
      >perl -MO=Concise,-exec -e"my $x; print $x" 1 <0> enter 2 <;> nextstate(main 1 -e:1) v:{ 3 <0> padsv[$x:1,2] vM/LVINTRO <---- 4 <;> nextstate(main 2 -e:1) v:{ 5 <0> pushmark s 6 <0> padsv[$x:1,2] l <---- 7 <@> print vK 8 <@> leave[1 ref] vKP/REFC -e syntax OK

      And yes, PadWalker is not distributed with Perl.

      > Since when is it in Core?

      very strange I never saw an installation without PadWalker but it's indeed not listed.

      UPDATE:

      corelist -a PadWalker<P> PadWalker was not in CORE (or so I think)

      urgh ... well ... hard to understand ... anyway I always need to install it when debugging and it's all about debugging.

      Cheers Rolf

        LanX just what are you doing that you rely so much on PadWalker?