in reply to Perl CGI gives HTTP error 500

Check the server error logs or try putting in use CGI::Carp qw(fatalsToBrowser); after your use strict; line. It'll send any error messages to the browser which should help you work out why your script is failing if that is the problem. :)
----------
My cow-orkers were talking in punctuation the other day. What disturbed me most was that I understood it.