CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
perl interpreter

 



divineshiva
New User

Sep 22, 2012, 7:33 AM

Post #1 of 3 (1174 views)
perl interpreter Can't Post

Hi,
I want to know if perl is implemented using interpreter or a compiler?
My guess is interpreter.Please confirm or rectify!


Chris Charley
User

Sep 22, 2012, 8:31 AM

Post #2 of 3 (1172 views)
Re: [divineshiva] perl interpreter [In reply to] Can't Post

http://search.yahoo.com/search;_ylt=AgvPe4Y3LfwxPWcBgCPMGSWbvZx4?p=perl+interpreted+compiled&toggle=1&cop=mss&ei=UTF-8&fr=yfp-t-701


Laurent_R
Veteran / Moderator

Sep 23, 2012, 8:37 PM

Post #3 of 3 (1159 views)
Re: [Chris Charley] perl interpreter [In reply to] Can't Post

The short answer is that a Perl script is definitely compiled before anything happens. If compilation fails, the program will not run. In purely interpreted languages, the program could possiblty run for a while before a syntax error is found and stops execution. In Perl, this is not so, the entire source code is compiled before execution starts. If an error is found, the execution will not start, which sort of proofs that this is really a compilation phase.

But a Perl script is not compiled into binary code directly understandable by the processor, as is the case for C or C++ code, for example (I am simplifying, but that's the idea). This has some advantages (portability) and some drawbacks (more limited performance, in some cases only).

A perl scrip is compiled into what could be called byte codes or operation codes, that are then ran by the perl interpreter, somewhat similarly to what happens with Java code and the Java virtual machine.

(OK, this is simplification, the comparison between Java and Perl does make senses, but, then, there are some significant différences).

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives