in reply to PERL & its IR

Perl is not compiled down to bytecode like Java. The code is left in tree form. You can use perl -MO=Terse script.pl to see the tree for a piece of code. See B::Concise for options.

Replies are listed 'Best First'.
Re^2: PERL & its IR
by dave_the_m (Monsignor) on Jan 27, 2005 at 18:15 UTC
    You can use Deparse to see the tree for a piece of code
    I think you meant to say you can use Concise:
    $ perl -MO=Concise -e '$a+$b' 6 <@> leave[1 ref] vKP/REFC ->(end) 1 <0> enter ->2 2 <;> nextstate(main 1 -e:1) v ->3 5 <2> add[t1] vK/2 ->6 - <1> ex-rv2sv sK/1 ->4 3 <$> gvsv(*a) s ->4 - <1> ex-rv2sv sK/1 ->5 4 <$> gvsv(*b) s ->5 -e syntax OK

    Dave.

Re^2: PERL & its IR
by aninymous (Initiate) on Jan 27, 2005 at 18:13 UTC
    hi, thanx for ur reply, So is "Deparse" a kind of s/w tool to see the parse tree & if so, from where can i get it?
      I posted too fast. I just updated my post to fix the module name, and to add more info.
        sorry, i didn't get my answer, i want to know how we can access the parse tree info of simple PERL prog