For me, mod_perl has 3 advantages over plain CGI:
- Performance. Everyone knows about this one: the Perl interpreter is embedded in the server process, the scripts are compiled only once. No forking and recompiling at every request.
- Access to all request phases. CGI is limited to the content delivery phase. mod_perl lets you write your own authentication handlers, access handlers, logging, whatnot. One very useful handler is the translation handler, which lets you determine how you will serve the content at runtime, as opposed to a static configuration.
- mod_perl exposes the Apache API, whereas mod_cgi only offers a handful of environmental variables. Escape URIs and encode HTML faster than those pure Perl modules from CPAN. Issue subrequests to do your own SSI-like thing. Many possibilities, the Apache API is very rich.