in reply to cgi or mod_perl

The main advantage of mod_perl over CGI is that mod_perl keeps your scripts compiled "in memory" so every next invocation of the same script does not suffer the usual start-up cost of starting a Perl-interpreter and loading and compiling the script.

The main disadvantage is that you must write these scripts very carefully. The persistence of your scripts could easily cause strange errors, such as variables retaining a previous value or unexpected closures happening over your subroutines.

An additional property of mod_perl is that this module opens the whole of the Apache server to you. Whether this is an advantage or a disadvantage depends on your point of view. System administrators or companies renting servers look at such power with dread and suspicion, hence your "run of the mill" webspace provider is more likely to point you towards PHP than towards mod_perl.

CountZero

A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James