Hi,

  I'm having problems with headers.  I know there is tons of stuff about
headers in the archives but none that I could find matches my situation.

  I have one script blah.cgi

  use strict;

  print qq(Content-Type: text/html\n\n);

  print qq(<html><body>);
  print qq(<form method=POST><input type=text name=blah><input type=submit>
  </form>);
  print qq(</body></html>);

  where the output in the browser includes Content-Type: text/html.  If I
were to remove the content-type print, the browser tells me that the
document contains no data, not a 500 malformed/premature end of script
headers that I'm familiar with.

  I have another script, in the same directory, test.cgi

  print "Server's environment<P>\n";
  print "<TABLE>";
  foreach ( keys %ENV )
  {
      print "<TR><TD>$_ </TD><TD>$ENV{$_}</TR></TD>";
  }
  print "</TABLE>";

  that never fails to output correctly, despite the fact that I'm not
printing headers.  If I add a content-type printout, it goes on to the
browser as well.  The difference is that doesn't fail like blah.cgi when
there isn't a header printout.

  With telnet I see something similar
   for test.cgi

   Escape character is '^]'.
   HEAD /test.cgi HTTP/1.0

   Server's environment<P>
   <TABLE><TR><TD>SERVER_SOFTWARE </TD><TD>Apache/1.3.9 (Unix) mod_perl/1.21
   more gobs of HTML.

   for blah.cgi with header printout
   Escape character is '^]'.
   HEAD /blah.cgi HTTP/1.0

   Content-Type: text/html

   <form method=POST><input type=text name=blah><input type=submit></form>
   </body></html>Connection closed by foreign host.

   for blah.cgi without header printout
   Escape character is '^]'.
   HEAD /blah.cgi HTTP/1.0

   <html><body><form method=POST><input type=text name=blah><input
   type=submit></form></body></html>Connection closed by foreign host.

  One might think that I have PerlSendHeader On, but as far as I can tell, I
don't.
   www# grep PerlSend httpd.conf
   www#

  This is my httpd.conf config
  <snip..>
   ### Perl
   PerlRequire /usr/local/etc/apache/startup.pl
   PerlFreshRestart On
   PerlSetupEnv Off
   <FilesMatch "\.cgi$">
        SetHandler perl-script
        PerlHandler Apache::RegistryNG->handler
   </FilesMatch>
  <snip..>

  I remember reading some documentation somewhere that PerlSendHeader if off
by default.  So I also tried explicitly turning it off by adding that
directive under PerlHandler Apache::Reg..., but the behavior is apparently
the same both via browser and telnet.

  Please help.  I'm so confused.

r.

Reply via email to