kyle has asked for the wisdom of the Perl Monks concerning the following question:
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).
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Request returns "200 OK", reports internal server error.
by perrin (Chancellor) on Sep 18, 2008 at 18:06 UTC | |
by kyle (Abbot) on Sep 18, 2008 at 18:33 UTC | |
by perrin (Chancellor) on Sep 18, 2008 at 18:37 UTC | |
by kyle (Abbot) on Sep 18, 2008 at 19:12 UTC | |
|
Re: Request returns "200 OK", reports internal server error.
by pjotrik (Friar) on Sep 18, 2008 at 19:42 UTC |