OK, this may be long, but stick with me.

The code that prints out the HTML is this:

sub print  {
my $self = shift;
$self->{'r'}->print(  @_        ) if $self->{'r'}; 
}

It is in a 3rd party module, EnsEMBL::Web::Document::Renderer::Apache.

I put in some debugging code thus:

sub print  {
my $self = shift;
$self->{'r'}->print(  @_        ) if $self->{'r'};
print STDERR "r is ", $self->{'r'}, "\n";
print STDERR "I was given '@_'\n";
}

Cleared out all config and tmp files, restarted the server and visited a
web page.  In my logs, I find:

r is Apache2::RequestRec=SCALAR(0x98d2108)
I was given '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
 <html xmlns="http://www.w3.org/1999/xhtml"; xml:lang="en-gb"
lang="en-gb">
 <head>
'

So, the perl code is using an Apache2::RequestRec object to print out
the header, and I am using a simple 'print STDERR' statement to print
out the same thing to the error log.  My 'print STDERR' statement works
fine and the header gets printed to the apache error log.  However, my
web page DOES NOT have an HTML header:

[Mon Apr 16 09:51:56 2007] [warn] /perl/Gallus_gallus/contigview did not
send an HTTP header

If I view source in IE, the very top of the web page starts:

  <title>Ensembl release 43: Gallus gallus Features on Chromosome 23
6042217-6042217</title>

I have put a screenshot here
http://coxpress.sourceforge.net/ens_error.jpg

If you scroll down you will see the special characters I am talking
about, plus the HTML in notepad showing the very top of the HTML.

My bet is that for some reason, the HTML header is being sent, or being
interpreted, in the wrong way and that results in IE displaying these
special characters.

Now, I don't really know what an Apache::SendRec object is or what it
does.  It looks like it dynamically loads some other package, but which?
Why is it mangling the headers when it prints?

Thanks in advance for your help
Mick

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Perrin
Harkins
Sent: 13 April 2007 14:08
To: michael watson (IAH-C)
Cc: modperl@perl.apache.org
Subject: Re: Malformed header from script

On 4/13/07, michael watson (IAH-C) <[EMAIL PROTECTED]> wrote:
> The script in question certainly attempts to print out
> "Content-type: text/html" and a whole "<HTML> blah" line, but these
> don't seem to be coming through

Can you show us the code you use to print the header, and the part of
httpd.conf where you configure this application?

- Perrin

Reply via email to