open FOO, "<$foo" or fatalerror "Couldn't Read Foo: $!"; # and off in an include file somewhere I define... sub fatalerror { my $email = $ENV{SERVER_ADMIN}; use HTML::Entities; my $code = encode_entities(shift); my $fm = <<"FRIENDLYMESSAGE";

Oops! I seem to have run into a problem! This is probably a bug in the software on this site, something that the webmaster needs to fix. If this problem persists, you can contact the webmaster at $email and report the problem. It might get fixed faster if you include the exact technical error code that follows.

Technical Error Code: $code

FRIENDLYMESSAGE # And then I output a page containing $fm in the # usual fashion. }