Search code examples
perl

How can I compile my Perl script so to reduce startup time?


Is there a way to save a compiled version of my perl scripts?

Or a way to do a JavaScript style compile where you just remove comments, whitespace, etc?


Solution

  • You're trying to optimize in the wrong place. If you are running scripts in a web/cgi environment, there is no need to take a compile hit every time the script is executed. The scripts should be running persistently, which you can do with Apache mod/perl, FastCGI, or a number of newer technologies and frameworks such as Plack and Catalyst. If you are more specific about your needs, you will discover that there are a number of options available to you.