[BNE-PM] The Perl one-liner

Derek Thomson derek at wedgetail.com
Fri Sep 20 01:19:42 CDT 2002


David Bussenschutt wrote:
 > I expect that I will eventually run in
> mod_perl, but I haven't needed that yet (or figured it out either)   ;-)
> 

I think you're going to have to look at mod_perl before too long. I've 
never done any CGI/Web app stuff whatsoever, so I can't really say how 
easy that will be.

Another approach would be to get all that work out of the CGI program, 
and into a server that sits on your machine permanently, and does all 
the "grunt work".

So, your setup looks like this (set your fonts to "fixed width"!):

+----------+                             +--------------+
| CGI      |  CORBA/SOAP/adhoc protocol  |  Perl server |
| "script" |---------------------------->|  process     |
+----------+                             +--------------+

So, your CGI script just connects to the server, passing the arguments, 
like say a cookie and some form fields, and gets back shiny new HTML to 
display. The server never dies, so not only is it "warmed up", but it 
can also cache database connections, keep those 6-12 sockets open for 
reuse, cache data from other sources, and so on ad infinitum. You can 
also move the server to a different, more powerful machine, or even 
replicate it across many machines!

You can use any protocol you like, ranging from standard, like CORBA or 
SOAP (which has the advantage that you can switch the server to 
Java/Python/C++/C at will without writing a bunch of code), or just make 
up your own little ASCII protocol and use that.

Anyway, even if you do use mod_perl, I think this design still has many 
benefits.

--
D.




More information about the Brisbane-pm mailing list