On Sep 24, 2002 at 23:14:02 +0200, [EMAIL PROTECTED] wrote:
> 
> At the first request each instance prints out the no_xhtml-header, but
> at the second call the no_xhtml-pragma is forgotten and the
> xhtml-header is printed out.
> 
> Is this a problem in the CGI-module or is there a deeper reason for
> this in mod_perl ?

The problem lies in CGI.pm itself. It installs a cleanup
handler which resets $CGI::XHTML to 1 after each request...

sub new {
    ....
    Apache->request->register_cleanup(\&CGI::_reset_globals);
    ....
}

sub _reset_globals { initialize_globals() };

sub initialize_globals {
    ....
    $XHTML = 1;
    ....
}

So you'll need to set $CGI::XHTML=0 every time you call
CGI->new to get it to work right.

--rick

Reply via email to