>is perl p-code?

yes they are called opcodes!

This example shows with the help of B::Terse how the sub take is called with 1+2 as parameter.

> perl -MO=Terse -e 'take(1+2)' LISTOP (0x976cdf0) leave [1] OP (0x9777078) enter COP (0x97542e8) nextstate UNOP (0x975fbb0) entersub [3] UNOP (0x975c8b8) null [142] OP (0x9754818) pushmark SVOP (0x975ca50) const [4] IV (0x9758ea8) 3 UNOP (0x975c878) null [17] PADOP (0x975c938) gv GV (0x9758eb8) *take -e syntax OK

And with B::Deparse you can even back-engineer an equivalent Perl code:

perl -MO=Deparse -e 'take(1+2)' take(3);

> I always thought of Perl as a purely interpreted language.

No that is (was) TCL's problem.

> Also, does anyone have any flow-diagrams of how source code makes it to machine code for each category (compiled, JIT, & interpreted)?

Well this is a Perl board! Look at BEGIN, UNITCHECK, CHECK, INIT and END for compilation phases of Perl.

Cheers Rolf


In reply to Re: is perl p-code? by LanX
in thread is perl p-code? by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.