@matheusbsbs / matheus-bagliano / commits / b1f5f64fc8
Fork 0

gitweb: Precompile CGI routines for mod_perl

Following advice from CGI(3pm) man page, precompile all CGI routines for mod_perl, in the BEGIN block. If you want to compile without importing use the compile() method instead: use CGI(); CGI->compile(); This is particularly useful in a mod_perl environment, in which you might want to precompile all CGI routines in a startup script, and then import the functions individually in each mod_perl script. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>

Jakub Narebski committed Dec 28, 2006 at 00:00 UTC b1f5f64fc831eb9f90bd07dc708279a921410bb2
1 file changed +4
gitweb/gitweb.perl
+4
@@ -18,6 +18,10 @@ use File::Find qw();
18 use File::Basename qw(basename);
19 binmode STDOUT, ':utf8';
20
21 +BEGIN {
22 + CGI->compile() if $ENV{MOD_PERL};
23 +}
24 +
25 our $cgi = new CGI;
26 our $version = "++GIT_VERSION++";
27 our $my_url = $cgi->url();