Looking at a compiler without some CS knowledge would be almost impossible I suspect, but an interpreter is somewhat easier

Still there is the parser where some knowledge about grammars(the CS kind), LR-parser, LL-parser, LALR-parser and so on could be useful. Maybe reading about it in wikipedia might give some background. Then you could take a look at lex/yacc and bison (open source software packages to parse computer languages, lex or yacc for the syntax, bison for the semantic) to see how a parser works and even do a simple example with them. But I suspect that perls "Do what I mean" combined with highly optimized code left the perl parser far removed from theory.

Another introducory text you might read would be http://compilers.iecc.com/crenshaw/ even though it is about compilers, you get a lot of background information

Then you should take a look at the internal representation/intermediate language used in perl from the outside. Take a minimal script and look at it with different debugging parameters "-Dx", see perlrun. For example "perl -D1 <yourminimalscript>" would show you how the tokens are translated to terms, expressions, scalars, blocks.... -D8 shows every step of the execution of the intermediate language.

With that background knowledge the source should make much more sense now


In reply to Re: Understanding the Perl Interpreter by jethro
in thread Understanding the Perl Interpreter 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.