Re: mod_perl -> application server

"Randolf Richardson" <[email protected]>
Newsgroups gmane.comp.apache.mod-perl
Organization Inter-Corporate Computer & Network Services
Message-ID <[email protected]>
	Hello Tosh.  I stopped using CGI.pm a very long time ago after 
learning about the apreq2 library which provides access to the 
Apache2::Request module.  Particularly, there is support for CGI 
parameters, including multiple file uploads from the same HTML form, 
and also the Cookie API:

		http://search.cpan.org/~isaac/libapreq2-2.13/glue/perl/lib/Apache2/Request.pm

	In addition to mod_perl2, you'll also need to install libapreq2.  On 
NetBSD (the server Operating System that I use), the packages and 
pkgin systems both support this very well with Apache HTTPd v2.2 and 
Apache HTTPd v2.4 on all of my production systems.  As I understand 
it, these modules are also supported very well on other flavours of 
Unix and probably most (if not all) distributions of Linux.

	Apache2::Request is not a drop-in replacement for CGI.pm (or at 
least it wasn't when I initially switched to Apache2::Request), but 
it does provide the functionality needed to handle HTTP's GET and 
POST methods used with HTML forms in a feature-rich manner with a lot 
of flexibility for handling file uploads.

	(I don't know if mod_perl2 provides support for accessing CGI 
parameters without apreq, and I have not looked into it.)

	After I first made the change from CGI.pm to using apreq2, I noticed 
that CPU utilization was dramatically lower during peak times for my 
busier web sites, so I felt that this was well worth the effort.

> Hi, after the recent discussion here about Perl application servers I 
> realized that the architecture I designed is probably better suited to 
> usage with an application server than mod_perl.
> 
> The basic structure of my mod_perl web application is:
> 
> *.pl files are handled by ModPerl::Registry
> 
> All *.pl files are structured in the following way:
> 
> #!/usr/bin/perl
> 
> use strict;
> use CGI;
> ...
> 
> &main;
> 
> sub main {
> ...
> }
> 
> 
> 
> I use CGI.pm 99% ONLY for dealing with input, $cgi->param() ... 99% of 
> output is either JSON or Template Toolkit generated HTML.
> 
> Should I be looking at CGI::Application?
> 
> Or CGI::PSGI?
> 
> Or even CGI::Emulate::PSGI ?
> 
> Should I ask this elsewhere?
> 
> Thanks for any advice!
> 
> Tosh
> 
> 
> -- 
> McIntosh Cooey - Twelve Hundred Group LLC - http://www.1200group.com/


Randolf Richardson - [email protected]
Inter-Corporate Computer & Network Services, Inc.
Beautiful British Columbia, Canada
http://www.inter-corporate.com/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.