You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Mag Gam <ma...@gmail.com> on 2008/02/01 04:54:00 UTC

Re: CGI versus Apache::Request -- confusion

All,
Thanks for the great explanation for newbies like me! Keep up the good work


On Jan 31, 2008 11:57 AM, Anthony Gardner <cy...@yahoo.co.uk> wrote:

> If you have a vanilla CGI script, every request you make to the webserver
> it's running on, will always create a new instance of that script, run it,
> return the values in a response and then the script ceases to exist in the
> server. The next time a request arrives for that script, the same sequence
> of events will start all over again. This becomes time consuming and a drag
> on the server's resources.
>
> ModPerl::Registry, wraps your CGI script up as a handler, and allows the
> webserver to keep the same CGI script alive in the webserver between
> requests. This cuts down an starting the script up for every request. It's
> faster.
>
> The request object is a structure that holds a lot of information,
> including params passed in from the request. How to use this request object,
> I outlined in my first mail to you. But the fact that it's available (should
> you need it) in your CGI script is because your CGI script magically becomes
> a handler. The first argument to any handler is the request object.
>
>
> I hope this helps.
>
> -Ants
>
> *Mag Gam <ma...@gmail.com>* wrote:
>
> But I am already reaping benefits of mod-perl. Not sure how
> ModPerl:Registy is going to help. What is its main benefits? Is it speed?
>
>
> On Jan 31, 2008 5:03 AM, Anthony Gardner <cy...@yahoo.co.uk>
> wrote:
>
> > The request object is used in handlers. You can either write handlers or
> > CGI scripts. Continue using CGI but inorder to reap the benifits of
> > mod-perl, you will need to run it under ModPerl::Registry.
> >
> > In your CGI script, while running under ModPerl::Registry., you even
> > have access to the request object.  If, at main::, you have my $r = shift;,
> > then you will get the object.
> >
> > I hope this helps.
> >
> > -Ants
> >
> >
> > *Mag Gam <ma...@gmail.com>* wrote:
> >
> > Hi All,
> >
> > I am  bit confused. While reading the mod_perl book, I noticed they are
> > using Apache::Request versus CGI for form data handling. Why is that? Is it
> > recommended to use Apache over CGI? Any advantages? I am using CGI because
> > its a standard module.
> >
> > TIA
> >
> >
> >
> >
> > Disclaimer: Technically, I'm always wrong!!
> > ------------------------------
> > Sent from Yahoo!<http://us.rd.yahoo.com/mailuk/taglines/isp/control/*http://us.rd.yahoo.com/evt=51949/*http://uk.docs.yahoo.com/mail/winter07.html>- a smarter inbox.
> >
>
>
>
>
> Disclaimer: Technically, I'm always wrong!!
>
> ------------------------------
> Sent from Yahoo!<http://us.rd.yahoo.com/mailuk/taglines/isp/control/*http://us.rd.yahoo.com/evt=51949/*http://uk.docs.yahoo.com/mail/winter07.html>- a smarter inbox.
>