How can I shorten the start time of a Perl CGI script?

I am developing some CGI scripts, and I am trying to find a solution to reduce the "initial time" created by importing a large number of modules using.

Update:

The proposed solutions are good, but the scripts that I run run in both console mode and CGI mode if some typical HTTP environment variables are present.

In "console mode" they upload data "normally", and in "html mode" they make some replacements in real time and send them to other HTTP headers to the client.

I would like to improve startup time in both cases.

+5
source share
6

CGI::Fast, perl . , CGI CGI:: Fast. mod_perl, CGI:: Fast , , Apache ( , , , mod_perl).

+12
+10
  • , .
  • , , .
  • , (, ) CGI .
  • , CGI ( , ).
+9

less :

use less 'starttime';

, *. mod_perl FastCGI: CGI:: Fast, FCGI, ...

, / ( FastCGI).

* , starttime .

+4

, , CGI , , CGI .

, . -, @INC, PERL5LIB, -, ( , ).

( ), , Class:: Autouse

!

+2

SpeedyCGI Persistent Perl.

: Perl , , , .

dual-environment, / CGI:: Fast mod_perl.

, . , , script .

+1

All Articles