in reply to cgi or mod_perl

...and I'll add my two cents. Do you manage the web server you'll be using? If not, mod_perl might be out of the question, since it's part of the web server.

You can use the CGI module without having total control of the web server, so my vote says concentrate on that.

Also, while mod_perl will make your code faster in a few situations, CGI.pm will make your code better in almost all situations. Go play with CGI.pm.

Performance is cool, but good code is cooler.

-Pileofrogs

Replies are listed 'Best First'.
Re^2: cgi or mod_perl
by donarb (Beadle) on Dec 24, 2005 at 19:34 UTC
    Note that using cgi is not the same as using the CGI.pm module. The main difference between cgi and mod_perl is that for mod_perl the perl interpreter is embedded in the Apache process.

    When writing/testing a web application, one advantage of cgi over mod_perl is that because cgi reloads your modules for each request, you can easily make changes without having to restart the server. mod_perl does have some tricks to get around that though.

    The CGI.pm module helps make using cgi on a server easier, it can parse POST parameters, bake cookies, and generate compliant HTML code. With mod_perl some of that functionality is provided by the Apache:: modules, but you can use some parts of CGI.pm in mod_perl as well. So by all means, whether you use cgi or mod_perl, you should learn how to work with CGI.pm.