Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I've narrowed down the problem to something this simple:
Here's the CGI script:
Here's the relevant part of my httpd.conf:#!/usr/local/bin/perl use strict; use CGI qw/:standard/; print header(); print start_html(); print "hello world\n"; print end_html;
And the snippet that is causing me the problem in Apache::NavBar:<Location /perl> SetHandler perl-script PerlHandler Apache::OutputChain Apache::NavBar Apache::Registry Options +ExecCGI </Location>
sub handler { my $r = shift; warn "OK handler\n"; warn "CT: ", $r->content_type, "\n"; $r->content_type eq 'text/html' || return DECLINED; warn "OK text/html\n";
Whenever I invoke the CGI script, I get this in the
output log:
OK handler
CT:
That's right. The call to $r->content_type produces no output, even though it's set by default in the CGI script. I've tried forcing the issue:
I even tried using bare print statements in case CGI.pm was doing something strange but I keep getting the same results. My guts tell me that I'm either missing something very fundamental in my understanding of the API or that something fishy is happening in mod_perl/Apache::Registry/Apache:OutputChain.print header(-type=>"text/html");
Some more information:
Red Hat 6.2 with all updates applied. If y'all want/need
specific versions I can dig them up.
Thanks for your help,
Colin Kuskie
|
|---|