A compiler runs over source code and generates output code without executing the output code. Generally the output winds up as native machine code that is subsequently executed in a different context.
An interpreter runs over source code and executes it as it goes (possibly compiling fragments into an intermediate representation).
Perl does both. It runs over the source code and compiles it into an intermediate form. It then "interprets" the intermediate form. Note that this gets somewhat more interesting when eval is involved because the code fragment passed into eval needs to be compiled and interpreted in its turn.
Update fix stupidty and add documentation links for eval
In reply to Re: Perl is a compiler cum interpreter?
by GrandFather
in thread Perl is a compiler cum interpreter?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |