On the web server that you are doing CGI programming, put the HTML pages with forms in a directory somewhere under the server's "document root" and the CGI program somewhere under the server's "cgi bin". The CGI program must have permissions properly set to be executed by the server. Furthermore, if the CGI program reads or writes to other files, then the server must have permission to do so. |
You should first debug your Perl program by executing it directly on the command line. If using ReadParse, there is a version that will also take input from STDIN. The param function of CGI.pm also allows this type of debugging: |
prog.pl < input.data |
When a CGI program has an error of any kind, it almost always generates an error message that the error is in the header. In fact, the error could be anywhere. |