Moin auch,
{
local *ERRDOC;
das nennt sich uebrigens Typeglob (weil es eben alle Typen umfasst)
if (open(ERRDOC, "<$errordocs_path/$code_page")) {
my $errdoc;
local $/; undef $/;
^^^^^^^^^
das kannst du dir sparen, passiert automatisch (weil du $/ nichts zuweist).
$errdoc = <ERRDOC>;
close(ERRDOC);
etwas ressourcensparender (nicht, dass es ins Gewicht fallen wuerde ;):
if (open(ERRDOC, "<$errordocs_path/$code_page")) {
print <<HEADER;
Status: $ENV{QUERY_STRING} $code
Content-type: text/html
HEADER
print while (<ERRDOC>);
}
else {
# aber hier nur verschoenert...
print <<EFH;
Status: 500 Internal Server Error
Content-type: text/html
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<HTML><HEAD><TITLE>500 Internal Server Error</TITLE></HEAD>
<BODY>Processing your request could not be completed due to the error <I>$ENV{QUERY_STRING} - $code</I>.<BR>
Additionally, an internal server error occurred while generating an approriate error document.<BR>
EFH
}