Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Compiled Perl

by gmpassos (Priest)
on Sep 10, 2004 at 20:31 UTC ( [id://390181]=note: print w/replies, xml ) Need Help??


in reply to Compiled Perl

One thing is to have an executable and other is to have your script parsed and compiled to be run.

Basically the process to run a Perl script starts with a parser that will read your script and understand what you wrote, than this parsed tree will be optimized, than a bytecode is created, and this bytecode is what the Perl interpreter will run.

You mentioned Apache, well, what Apache does is just a Perl interpreter that doesn't die, the Apache process will stay running, so, you just resume a Perl script, that actually is not a script, is a mod_perl module that has a framework to follow.

If what you want is to create an executable, in other words, do not need to have the Perl interpreter installed to run your script, you can take a look in this modules: PAR, App::Packer, LibZip.

What this modules above will do is to create a binary of the Perl interpreter with your script inside, and the interpreter will run automatically your code when executed, basically is that.

Now if what you want is to make the load process of your script faster, in Perl5 the idea to save the bytecode to run it directly doesn't work very well, since the load process of a code is not just the creation of a bytecode, but we can load libraries (XS code, DLL), and we change the status of the interpreter that are not represented in the bytecode, like the IO status, let's say an file openned. But this will work very well on Perl6, but you will need to wait for it.

So, to make the load process faster we always use the idea of a persistent interpreter, like with the of FastCGI, mod_perl and pperl.

Graciliano M. P.
"Creativity is the expression of the liberty".

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (3)
As of 2024-04-19 18:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found