http://qs321.pair.com?node_id=600153


in reply to Re: Perl is a compiler cum interpreter?
in thread Perl is a compiler cum interpreter?

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.

From perldoc -f eval

In the second form, the code within the BLOCK is parsed only once--at +the same time the code surrounding the "eval" itself was parsed--and execu +ted within the context of the current Perl program. This form is typicall +y used to trap exceptions more efficiently than the first (see below), while also providing the benefit of checking the code within BLOCK at compile time.

P.S.: I'm posting this for those like I had somekind of doubt if eval BLOCK interprets and compiles the code inside BLOCK. The answer is no.

Igor 'izut' Sutton
your code, your rules.