An essential part of any CGI written in perl that will push all the fatal errors to the browser instead of punting with the all-too-familiar 500 Internal Server error:
use CGI::Carp qw(fatalsToBrowser);