[sf-perl] CGI working

Neil Heller nheller at silcon.com
Sat Mar 1 21:17:28 PST 2008


Are you saying that using plain Perl CGI programs in Apache means that the
application (really the script, in this case) will NOT stay in memory
between invocations?  That's a bummer for me.

Neil Heller



-----Original Message-----
From: sanfrancisco-pm-bounces+nheller=silcon.com at pm.org
[mailto:sanfrancisco-pm-bounces+nheller=silcon.com at pm.org] On Behalf Of
Michael Friedman
Sent: Saturday, March 01, 2008 6:10 PM
To: San Francisco Perl Mongers User Group
Subject: Re: [sf-perl] CGI working

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>
---------------------------------------------------------------------


_______________________________________________
SanFrancisco-pm mailing list
SanFrancisco-pm at pm.org
http://mail.pm.org/mailman/listinfo/sanfrancisco-pm



More information about the SanFrancisco-pm mailing list