in reply to Running CGI scripts without a server

Other people suggested setting up a local web server. This is probably the best way to develop CGI scripts because it mimics how it will run on a real web site. You won't be surprised by differences between development and production environments when you deploy it.

It is possible to run CGI scripts from the command line. This is very useful for a quick test. You can capture the output, and display the HTML file in a browser. Doing this for multiple pages or interaction will be a really slow process. And there are some things like cookies that won't work right. For example, the HTTP headers will show up at the top of the page unless you remove them in an editor.

perl script.cgi > script.html