Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: How is a perl program processed ?

by Zaxo (Archbishop)
on Apr 01, 2003 at 06:40 UTC ( [id://247160]=note: print w/replies, xml ) Need Help??


in reply to How is a perl program processed ?

Perl is compiled, but it doesn't give that impression because it does not save an executable image. Instead, compilation is done on startup (like an interpreter), then the compiled program is automatically run.

The compiler produces a parse tree for the perl statements it encounters, then the runtime walks through the parse tree executing the primitives it finds there. Details may be found in the Camel Book, or in the perl documentation.

Update: perlguts and perlcompile have the most clues to how perl works. Note that perl can drop into compiling from running and vice versa with eval, BEGIN blocks, and so on.

After Compline,
Zaxo

Replies are listed 'Best First'.
Re: Re: How is a perl program processed ?
by Cody Pendant (Prior) on Apr 01, 2003 at 06:50 UTC
    This might be a dumb question, but where is the answer to this question in the man pages or other documentation? I did a quick look and couldn't find anything.

    Update though I did find this page from YAPC 2000 -- "A Perl Novice ... Wonders why no one can give him a straight answer about whether Perl is compiled or interpreted." --

    “Every bit of code is either naturally related to the problem at hand, or else it's an accidental side effect of the fact that you happened to solve the problem using a digital computer.”
    M-J D
Re: Re: How is a perl program processed ?
by TheYoungMonk (Sexton) on Apr 01, 2003 at 07:01 UTC
    Thanx !

    Any place on the web where we can find some documents related to the origin of perl and the details which u had given ???

    The documentation doesn't give these details !!<p

Re: Re: How is a perl program processed ?
by abhishes (Friar) on Apr 01, 2003 at 16:54 UTC

    I will like to add another question then, does perl do JIT compilation then? or does it compile the entire program at startup and loads the entire code in memory?

    regards,
    Abhishek.

      The optree is created once and only once unless things like B::Generate are active in which case manual alterations are possible (and of course eval and require also compile new code). Perl doesn't do JIT - people smarter than I can speak about Parrot's JIT.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://247160]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (3)
As of 2024-03-29 07:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found