#!/usr/bin/perl -w use strict; use CGI::Carp qw|set_die_handler|; use Foobar; BEGIN { sub extra_special_die_handler { my ($msg) = shift; print qq|Content-Type: text/html\n\n|; print qq||; print qq|

Error

|; print qq|$msg|; } set_die_handler(\&extra_special_die_handler); } open( STDERR, '>>', 'testerror.log'); my $foo = Foobar->new(); print $foo->fooish(); print qq|\n\nall okay\n|; close(STDERR);