I apologize if this is a dumb question, but I just installed Apache and
mod_perl and all seems to have gone well.  The trouble comes in when I try
to run a script using Apache::Registry and CGI.pm.  I get an extra
Content-Type in the resulting page, and I can't figure out where it's coming
from.

First example:

#!/usr/bin/perl

print "Content-Type: text/html\n\n";
print "<html><head><title>boo</title></head>";
print "<body><h1>I was here.</h1></body></html>";


This work fine.

Second example:

#!/usr/bin/perl
use CGI qw(:standard);

print header(),
      start_html(-title=>'boo'),
      h1("this doesn't work!!!"),
      end_html();

This second example ends up printing "Content-type: text/html" at the top of
the page.  Is there something in httpd.conf that tells the server to print
the content type automatically?  Why does the first example work if the
second doesn't, if ultimately they should both end up printing more or less
the same thing.

If I run the second example as a regular CGI script (not under mod_perl) it
comes out fine.

so, I'm stumped.  But I know it's something painfully obvious.

thanks,

-john.


Reply via email to