"Benjamin Reed" <[EMAIL PROTECTED]> writes:
> I've turned off PerlSendHeader, but no matter what I do, it seems that I'm
> already getting headers before I ever print anything.
If you turn PerlSendHeader off, you are responsible for sending the
headers yourself. In the Apache API, and mod_perl's incarnation of
it, sending the headers is achieved by calling $r->send_http_header,
after having set the header values using calls such as
$r->content_type("text/html"). Read 'perldoc Apache' to see all the
stuff that you can put into the headers in this way.
With PerlSendHeader on, mod_perl emulates mod_cgi by slurping up the
initial non-blank lines from your output and doing the above for you,
behind the scenes.
> I have the following in my httpd.conf:
>
> ---(snip!)---
> Alias /perl/ /home/httpd/perl/
> <Location /perl>
> SetHandler perl-script
> PerlHandler Apache::Registry
> PerlSendHeader Off
> Options Indexes ExecCGI
> </Location>
> ---(snip!)---
>
> If I have a script called /home/httpd/perl/index.pl with only the following:
>
> ---(snip!)---
> $|++;
> print <<END;
> Content-type: text/html
>
> Hi.
> END
> ---(snip!)---
That should be
use Apache;
my $r = Apache::Request;
$r->content_type('text/html');
$r->send_http_header;
$r->print('Hi.');
--
Frank Cringle, [EMAIL PROTECTED]
voice: (+49 2304) 467101; fax: 943357