{ my( $warn, @warns ); BEGIN { $warn= sub { my( $head, $tail )= ( @_, "", "" ); if( @warns ) { print "\n$head
Warnings:
\n",
@warns, "$tail\n";
@warns= ();
}
};
$SIG{__WARN__}= sub {
push @warns, $_[0];
};
$SIG{__DIE__}= sub {
print "Content-Type: text/html\r\n\r\n",
"Died because:\n
$_[0]", "\n"; exit 0; }; } END { &$warn( "", "" ); } }