You can get a server error for the following reasons:
If the script does not contain the "#!/usr/bin/perl" header line that points to the Perl interpreter, or if the path to the interpreter(and/or a library file) is invalid.
If the first line output from the script is not a valid HTTP header (i.e "Content-type: text/html"), or if there is NO blank line after the header data. If there is a syntax error in your script. Always run it from the command-line first.