#!/usr/bin/perl
#error3.pl

use CGI;
use CGI::Carp qw(fatalsToBrowser set_message);

BEGIN {

	sub handle_errors {
		my $msg = shift;
		print "<H1>You goofed! Serves you right ";
		print "that you didn't handle your errors properly</H1>";
		print "$msg";
	}

	&set_message (\&handle_errors);

}


$cgi = new CGI;

print $cgi->header();

print "About to die from a fatal error of some kind<br>\n";

die "Here's a made up error";

print "Did you get the message";