On Mon, 1 Oct 2001, Alex Harper wrote: > Date: Mon, 1 Oct 2001 16:16:34 -0500 > From: Alex Harper <[EMAIL PROTECTED]> > To: [EMAIL PROTECTED] > Subject: CGI.pm params not being cleared? > > I'm sure this is a FAQ somewhere, but I'm not finding it... > > In our switch to mod_perl we're seeing two problems with CGI.pm (version > 2.752). I'm uncertain if they are related or not. > > 1. Across multiple requests to a single script, the params are not > cleared. The first params sent to that script (per Apache server) are > wedged permanently. It doesn't seem to matter if the params came from > GET or POST. > > 2. Despite precompiling CGI.pm using its compile method in our mod_perl > startup, we constantly see warning for CGI.pm subroutine redefinitions > ("start_html", etc.) > > We precompile CGI.pm in our mod_perl startup as follows (from the > guide): > use CGI qw(-compile :all); > > In the script in question params are read like so: > use CGI; > $cgi = new CGI; > if ($cgi->param("dataaction") eq "whatever") { > # Does something useful > }
Perhaps you ought to declare "$cgi" with a "my"? > Some of our modules also create (and destroy) CGI objects, but none of > them are global, and I can't see any way for the script to be getting > confused with a module's copy (the script itself does not user those > modules, though they are precompiled during mod_perl startup). > > Obviously I must be doing something wrong... Any suggestions? Well, despite CGI.pm's overall usefulness, is there any reason you don't use Apache::Request? It's definitely faster. ky