help-gnats
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Gnatsweb under mod_perl


From: Dirk Bergstrom
Subject: RE: Gnatsweb under mod_perl
Date: Thu, 18 Oct 2001 15:03:01 -0700

> I am wondering if anyone have attempted to run Gnatsweb under
> mod_perl? I am not acquainted with mod_perl, but I'd be interested
> in making Gnatsweb more compatible with it. So if anyone has tried
> this, I'd be interested to know what modifications were necessary
> and in general what steps had to be taken to make it work.

i haven't tried it, and i don't know much about mod_perl (so why is he
writing?), but i've given it some thought.

seems to me that the big benefit of running under mod_perl would be
caching of gnats database info (catgories, responsible, submitter-id,
field names & valid values).  it would be a big savings if we didn't
have to request, read & parse all that for every request.

however, my understanding of mod_perl is that to really take advantage
of the power inherent in the system, a program needs to keep a clean
namespace -- all the variables should be lexically scoped.  gnatsweb has
an appalling number of global variables, and it would never fly as a
real mod_perl app.

it could, however, work under the Apache::PerlRun module, which allows
use of (mostly) unmodified cgis.  unfortunately, you don't get much
benefit from that (CGI.pm and the perl interpreter stay resident, but
gnatsweb needs to be restarted from scratch for every request).

this page has some good info on porting to mod_perl:

http://www.perlreference.com/mod_perl/guide/porting.html

a good start towards making gnatsweb mod_perl friendly would be to move
all the config variables into a hash.  instead of twenty individual
vars, we have one hash, with twenty keys.  this would mean that we could
add new config switches without declaring the variables; and a
gnatsweb-site.pl file would work with any version of gnatsweb (that
supported the config hash).  as it stands, if you try to use a new
version of the site.pl file with an old version of gnatsweb, it chokes
on the undeclared config var.

--
Dirk Bergstrom               address@hidden
_____________________________________________
Juniper Networks Inc.,          Computer Geek
Tel: 707.433.0564           Fax: 707.433.0769


reply via email to

[Prev in Thread] Current Thread [Next in Thread]