Why do these sloppily written scripts work under mod_cgi? The reason
lies in the way mod_cgi invokes them: every time a Perl CGI script is
run, a new process is forked, and a new Perl interpreter is loaded.
This Perl interpreter lives for the span of the
request's life, and when the script exits (no matter
how), the process and the interpreter exit as well, cleaning up on
the way. When a new interpreter is started, it has no history of
previous requests. All the variables are created from scratch, and
all the files are reopened if needed. Although this detail may seem
obvious, it will be of paramount importance when we discuss mod_perl.