Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

settle a bet: is perl a script?

Status
Not open for further replies.

redss

Programmer
Joined
Oct 20, 2002
Messages
195
I've got a little disagreement with a coworker, I'm trying to tell him that perl is not a true "scripting language" and the term "perl interpretter" is incorrect because as I understand it, perl compiles down to native code when executed, am I correct?

Isn't it more accurate to call it a perl JIT compiler rather than perl "interpretter"?

As I understand it, executing a perl script will compile all the code before executing which is why it finds syntax errors ahead of time... whereas a true interpretter won't choke on bad syntax until it tries to execute it... thoughts anyone?

 
From Oreilly's Perl In a Nutshell. Chapter 3, The Perl Interpreter.

"So what does the Perl interpreter do? It compiles the program internally into a parse tree and then executes it immediately. Perl is commonly known as an interpreted language, but this is not strictly true. Since the interpreter actually does convert the program into byte code before executing it, it is sometimes called an interpreter/compiler, if anything at all. [1] Although the compiled form is not stored as a file, release 5.005 of Perl includes a working version of a standalone Perl compiler.

[1] So do you call something a Perl "script" or a Perl "program"? Typically, the word "program" is used to describe something that needs to be compiled into assembler or byte code before executing, as in the C language, and the word "script" is used to describe something that runs through an interpreter, as in the Bourne shell. For Perl, you can use either phrase and not worry about offending anyone."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top