in reply to Basic error in CGI script

Well, do what the web server told you: Look into the error log, there you will find a more useful message.

On a web server NOT connected to the internet, you could also insert use CGI::Carp qw(-fatalsToBrowser); into your script. But NEVER do that on a server connected to the internet, it exposes way too much information for a malicious attacker.

Taint mode (-T) is a very good idea, warnings (-w) are too, but your code lacks use strict;. Add that to your code.

Also note that Perl requires a block after if, unlike C.

Alexander

--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)