Writing mod_ perl Scripts

In general, writing CGI scripts to run under mod_perl doesn’t differ much from writing them for execution under a standalone Perl process. Therefore, if you create a standalone script in the cgi-bin directory, you often can expect that moving it to the cgi-perl directory won’t cause problems, the script will just run faster. The perl-test.pl script we used earlier to test the mod_perl configuration was an example of this: It functioned properly whether run from cgi-bin or from cgi-perl. You can try this with other scripts as well. For example, you can move the scripts developed in Chapter 2 from cgi-bin to cgi-perl to see whether they work properly.

That’s not to say that there are never any problems using CGI scripts ...

Get MySQL and Perl for the Web now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.