From b07844180e9ec343d02f8ce7010e2d615560914f Mon Sep 17 00:00:00 2001 From: short <> Date: Sun, 31 Jul 2005 00:06:48 +0000 Subject: [PATCH] Cosmetic: Prevent warn: Headers already sent --- Web.pm | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Web.pm b/Web.pm index 33324e1..6a4d6ab 100644 --- a/Web.pm +++ b/Web.pm @@ -295,12 +295,16 @@ my($msg)=@_; $msg="UNKNOWN" if !$msg; cluck "FATAL: $msg"; - $W->{"indexme"}=0; # For the case no heading was sent yet. # Do not send it unconditionally. # The intial duplicated '{"heading_done"}=0 if $W->{"header_only"}; - $W->{"header_only"}=0; # assurance for &heading - My::Web->heading(); + # Do not send it unconditionally. + # Prevents warn: Headers already sent + if (!$W->{"heading_done"}) { + $W->{"indexme"}=0; # For the case no heading was sent yet. + $W->{"header_only"}=0; # assurance for &heading + My::Web->heading(); + } Wprint "\n".vskip("3ex")."

FATAL ERROR: $msg!

\n" ."

You can report this problem's details to" ." ".a_href("mailto:".$W->{"admin_mail"},"admin of this website").".

\n"; -- 1.8.3.1