![]() |
|< 1 2 3 4 >| | ![]() |
34 Einträge, 4 Seiten |
1
2
3
4
5
<Location /your/script.cgi>
SetHandler perl-script
PerlHandler Apache::Registry
Options +ExecCGI
</Location>
1
2
3
4
5
6
7
8
9
10
<Location /cgi-bin/index.pl>
SetHandler perl-script
PerlHandler Apache::Registry
Options +ExecCGI
</Location>
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^/index\.html$ /cgi-bin/index.pl [PT]
</IfModule>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
Global Variables
It's always a good idea to stay away from global variables when possible. Some variables must be global so Perl can
see them, such as a module's @ISA or $VERSION variables. In common practice, a combination of "use strict" and "use
vars" keeps modules clean and reduces a bit of noise. However, use vars also creates aliases as the Exporter does,
which eat up more space. When possible, try to use fully qualified names instead of use vars. Example:
package MyPackage;
use strict;
@MyPackage::ISA = qw(...);
$MyPackage::VERSION = "1.00";
vs.
package MyPackage;
use strict;
use vars qw(@ISA $VERSION);
@ISA = qw(...);
$VERSION = "1.00";
Further Reading
In case I forgot to mention, read Vivek Khera's the mod_perl_tuning manpage document for more tips on improving
Apache/mod_perl performance.
use vars qw($sessionid %uid_hash);
![]() |
|< 1 2 3 4 >| | ![]() |
34 Einträge, 4 Seiten |