Yes, perl is an interpreter. But it does not work like the early interpreters did (read a line, interpret it, execute it, go on to the next line). What happens is, once you start the script, the code gets parsed and "compiled" into an internal parse tree, aka bytecode format.
The "anti" is the "run time". That is when the Perl interpreter is executing the bytecode.
Update:
The article FMTEYEWTK about Compilation vs Interpretation in Perl provides more detail.
| [reply] |
What is the "compilation time", I know perl is an interpreted language, so I guess there 'must' be an 'anti' for "compilation time" what is it?
Perl is an interpreted language in that you don't have to explicitly compile your program before running it, like you have to do in C. However, Perl is also a compiled language in that the Perl interpreter (compiler) automatically compiles your program into an intermediate code before it runs it. Hence, "compile time" and "run time."
If there are any syntax errors in your code, compilation fails. If compilation succeeds, you may still have logical errors and your program may not do what you expected it to do. There are also things you can do that happen at compile time (for example, a BEGIN block) before the rest of the program actually runs.
--
when small people start casting long shadows, it is time to go to bed
| [reply] |
eval (the quoted string version) basically gets the Perl interpreter to start up again on a new section of code, compiling it, intrepreting it, and executing it. I'm not sure what you mean by "...use eval for variable is the instruction will run at compilation time?" Perhaps you can rephrase that portion of the question if you're still unclear on the answer.
| [reply] |