Skip to content

Commit

Permalink
gitweb: Precompile CGI routines for mod_perl
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jakub Narebski authored and Junio C Hamano committed Dec 28, 2006
1 parent 45c9a75 commit b1f5f64
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions gitweb/gitweb.perl
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
use File::Basename qw(basename);
binmode STDOUT, ':utf8';

BEGIN {
CGI->compile() if $ENV{MOD_PERL};
}

our $cgi = new CGI;
our $version = "++GIT_VERSION++";
our $my_url = $cgi->url();
Expand Down

0 comments on commit b1f5f64

Please sign in to comment.