[sf-perl] CGI working

Michael Friedman friedman at highwire.stanford.edu
Sat Mar 1 18:09:35 PST 2008

If you are using mod_perl (or a similar setup for non-apache  
webservers) it will stay in memory between invocations. If you are  
just using CGI.pm and launching the program from a directory path,  
then it gets called anew each time.

The CGI spec says that the webserver will call out to the program anew  
every time. That is the same no matter what language the program is  
written in: perl, python, C, bash shell, etc. It's a really expansive  
feature, since you can do anything you can do on the machine from the  
webserver, but it's a bit slow due to the repeated instantiations. ;-)

You should check the documentation for your webserver about how it  
handles CGI scripts for further details.

-- Mike

On Mar 1, 2008, at 5:32 PM, Neil Heller wrote:

> I looked and looked unsuccessfully to directly find the answer to my
> question.  I was hoping someone here knew off the top of his head.
> When a Perl-CGI program is launched, does it stay in memory as a  
> singularity
> (like J2EE) or does it instantiate anew each time it's called?
> _______________________________________________
> SanFrancisco-pm mailing list
> SanFrancisco-pm at pm.org
> http://mail.pm.org/mailman/listinfo/sanfrancisco-pm

Michael Friedman                     HighWire Press
Phone: 650-725-1974                  Stanford University
FAX:   270-721-8034                  <friedman at highwire.stanford.edu>

More information about the SanFrancisco-pm mailing list