Datasheet

“main” (Installation and Administration) 2004/6/25 13:29 page 546 #572
i
i
i
i
i
i
i
i
</Location>
#
# set Apache::PerlRun Mode for /cgi-perl Alias
#
<Location /cgi-perl>
SetHandler perl-script
PerlHandler Apache::PerlRun
Options ExecCGI
PerlSendHeader On
</Location>
</IfModule>
These entries create aliases for the Apache::Registry and
Apache::PerlRun modes. The difference between these two modes is
as follows:
Apache::Registry All scripts are compiled and kept in a cache. Every
script is applied as the content of a subroutine. Although this is good
for performance, there is a disadvantage: the scripts must be pro-
grammed extremely carefully, as the variables and subroutines persist
between the requests. This means that you must reset the variables to
enable their use for the next request. If, for example, the credit card
number of a customer is stored in a variable in an online banking
script, this number could appear again when the next customer uses
the application and requests the same script.
Apache::PerlRun The scripts are recompiled for every request. Vari-
ables and subroutines disappear from the namespace between the
requests (the namespace is the entirety of all variable names and rou-
tine names that are defined at a given time during the existence of a
script). Therefore, Apache::PerlRun does not necessitate painstak-
ing programming, as all variables are reinitialized when the script is
started and no values are kept from previous requests. For this rea-
son, Apache::PerlRun is slower than Apache::Registry but still
a lot faster than CGI (in spite of some similarities to CGI), because no
separate process is started for the interpreter.
546
22.9. Active Contents