in reply to creating an error message

If this is a CGI app or similar, adding the following at the top of your script will help in returning more detailed errors for problems such as this than simply "500 internal server error":
#!/usr/bin/perl -w # as normal use strict; use warnings; use CGI::Carp "fatalsToBrowser";
Dan