Perl is somewhat of a hybrid between interpreted and compiled languages. There is indeed an interpreter that interprets the scripts, but it does not execute the interpreted code directly. Rather, it builds bytecode that in it's turn gets executed. The generation of the bytecode can be seen as a compilation step.

If you're interested, you can have a look at the bytecode of a script using the B::Bytecode module. For example:

$ perl -MO=Bytecode -e '$camel="flea-ridden";print $camel;' >bytecode
The file bytecode contains the bytecode.

In Perl6, this will be taken to the next step, and there will be a bytecode interpreter that's seperate from the Perl interpreter. This is parrot.

Update: As diotalevi rightly (if rather succinctly ;) ) points out, there is no bytecode. In fact, what I mistakingly and confusingly call bytecode, is in fact a serialisation of the internal optree the Perl interpreter generates. So, substitute 'optree' for 'bytecode' in the above, and you get an equally confusing, yet more correct explanation.

CU
Robartes-


In reply to Re: How is a perl program processed ? by robartes
in thread How is a perl program processed ? by TheYoungMonk

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.