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".