saberworks has asked for the wisdom of the Perl Monks concerning the following question:
According to the CGI.pm docs, the CGI::header method is supposed to discard the leading dash, turn underscores into dashes, format the header, and return it. So you have to print it.print $cgi->header(-X_error_code => 1);
So I dug around in CGI.pm and in the header method I found this code:perl -MCGI=header -we'print header('-X_error_code' => 1)'
I'm assuming this means CGI.pm wants to think it is smart enough to dispatch the headers instead of just returning them IF it is running under mod_perl. To me, this seems like an extremely silly assumption (pretend I'm using the formatted headers for something else, not just printing them). Furthermore, even if it did want to do that, apparently passing them to the r->send_cgi_header method isn't working regardless.if ($MOD_PERL and not $nph) { $self->r->send_cgi_header($header); return ''; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: mod_perl and CGI::header
by PodMaster (Abbot) on Sep 30, 2005 at 00:04 UTC |