]> Lady’s Gitweb - Gitweb/commit
gitweb: Fix mod_perl support.
authorAlexander Gavrilov <redacted>
Wed, 5 Nov 2008 22:10:07 +0000 (01:10 +0300)
committerLady <redacted>
Mon, 6 Apr 2026 04:50:38 +0000 (00:50 -0400)
commit9a00f2bad8f9cf115358c2ba29d34e1ec9060662619ac95a20c91b3bdc4e3299
tree8b87c97497999a2518dedc6f6add71e7571bc8b6fa95bf40407893919e06fa69
parent01243a50328ba47405d3307dc6c097d00ea149905018a4b6ca65666a1d1193ea
gitweb: Fix mod_perl support.

ModPerl::Registry precompiles scripts by wrapping them
in a subroutine. This causes ordinary subroutines of the
script to become nested, and warnings appear:

gitweb.cgi: Variable "$path_info" will not stay shared

This warning means that $path_info was declared as 'my',
and thus according to the perl evaluation rules all nested
subroutines will retain a reference to the instance of the
variable used in the first invocation of the master script.

When the script (i.e. the master meta-subroutine) is executed
the second time, it will use a new instance, so the logic
breaks. To avoid this it is necessary to declare all global
variables as 'our', which places them at the package level.

Signed-off-by: Alexander Gavrilov <redacted>
Acked-by: Jakub Narebski <redacted>
Signed-off-by: Junio C Hamano <redacted>
gitweb.perl
This page took 0.215075 seconds and 4 git commands to generate.