Re: Problems w/ CGI under mod_perl

2000-01-26 Thread Doug MacEachern

 perhaps you should call 
 
 Apache-request-new($r)-register_cleanup(\CGI::_reset_globals);

there is no Apache::new method

the problem here (which has come up many times in the past), is that
CGI.pm uses the Apache-request method to get a reference to the global
$r.  this normally isn't set until the response phase, unless you do it
yourself, which can be done with a line of config like so:
 
PerlPostReadRequestHandler 'sub { Apache-request(shift) }'



Re: Problems w/ CGI under mod_perl

2000-01-19 Thread Ken Y. Clark

On Wed, 19 Jan 2000, Richard L. Goerwitz wrote:

 Before I turn everything inside out, let me ask a quick question:  Has
 anyone encountered problems using CGI and CGI::Cookie with mod_perl?  The
 Problem I am noticing emanates from CGI-new().  Here's the section of
 code:
 
 if ($MOD_PERL) {
 Apache-request-register_cleanup(\CGI::_reset_globals);
 undef $NPH;
 }
 
 The error I'm seeing is (taken from my Apache log files):
 
 Wed Jan 19 11:33:45 2000] [error] Can't call method "register_cleanup" on an
 undefined value at /usr/lib/perl5/5.00503/CGI.pm line 263.
 


perhaps you should call 

Apache-request-new($r)-register_cleanup(\CGI::_reset_globals);
 
??

just a thought.

ky



Re: Problems w/ CGI under mod_perl

2000-01-19 Thread James G Smith

"Richard L. Goerwitz" [EMAIL PROTECTED] wrote:
Before I turn everything inside out, let me ask a quick question:  Has
anyone encountered problems using CGI and CGI::Cookie with mod_perl?  The
Problem I am noticing emanates from CGI-new().  Here's the section of
code:

if ($MOD_PERL) {
Apache-request-register_cleanup(\CGI::_reset_globals);
undef $NPH;
}

The error I'm seeing is (taken from my Apache log files):

Wed Jan 19 11:33:45 2000] [error] Can't call method "register_cleanup" on an
undefined value at /usr/lib/perl5/5.00503/CGI.pm line 263.

Platform:  RedHat Linux 6.1 + from-scratch build of Apache 1.3.9, mod_perl
1.21

I have seen this with a build from .tar.gz on OpenBSD 2.5 also with 
Apache/1.3.6 (Unix) mod_perl/1.21.  Slightly older Apache, but I don't think 
that's the problem.

I have never seen a good pattern to this, but there are times when the Apache-
request object is undefined in a mod_perl handler.  Sometimes, calling Apache-
request($r) immediately upon entering a handler will fix it, sometimes even 
that won't work ($r is sometimes underfined when entering a handler).
-- 
James Smith [EMAIL PROTECTED], 409-862-3725
Texas AM CIS Operating Systems Group, Unix