My fellow monks,

I'm hoping someone else has run across this before because it looks pretty odd to me.

I have a request that, when run appears to produce the page it's supposed to, but at the end of the page source, there's this:

</html>HTTP/1.1 200 OK Date: Thu, 18 Sep 2008 17:05:29 GMT Server: Apache/1.3.34 (Ubuntu) mod_perl/1.29 Keep-Alive: timeout=8, max=99 Connection: Keep-Alive Transfer-Encoding: chunked Content-Type: text/html; charset=iso-8859-1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <HTML><HEAD> <TITLE>200 OK</TITLE> </HEAD><BODY> <H1>OK</H1> The server encountered an internal error or misconfiguration and was unable to complete your request. <!-- ...more stuff... -->

There is nothing in the error logs.

I've narrowed it down to here in the application:

# process template page my $t = $self->template; $t->process( $template, $template_vars, $output ) or die sprintf q{Template error in '%s': %s}, $template, $t->err +or(); return OK; }

If I stick a print in right before the return, it appears between the end of the valid page and the beginning of the "OK error message".

My guess is that something is going haywire during object destruction somewhere, but I haven't thought of a way to debug this. If any monk has some insight, I'd really appreciate it.

Update: As it turns out this was caused by that little problem with Error in which someone tries to return from within one of its blocks and winds up returning to just outside the block instead—because the block is secretly an anonymous sub. Execution would fall off the end of the enclosing sub without ever hitting a return, and most of the time it just so happened that the last value evaluated (and therefore returned) would be the same as the value returned by OK() (specifically, zero).


In reply to Request returns "200 OK", reports internal server error. [solved] by kyle

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.