CGI versus Apache::Request -- confusion

CGI versus Apache::Request -- confusion

am 31.01.2008 07:26:42 von Mag Gam

------=_Part_24561_3532279.1201760802957
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

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

------=_Part_24561_3532279.1201760802957
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

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



------=_Part_24561_3532279.1201760802957--

Re: CGI versus Apache::Request -- confusion

am 31.01.2008 11:03:29 von Anthony Gardner

--0-632855894-1201773809=:24581
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit

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 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! - a smarter inbox.
--0-632855894-1201773809=:24581
Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: 8bit

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 <magawake@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 Apach
e over CGI? Any advantages? I am using CGI because its a standard module.

TIA




Disclaimer: Technically, I'm always wrong!!



Sent from - a smarter inbox.
--0-632855894-1201773809=:24581--

Re: CGI versus Apache::Request -- confusion

am 31.01.2008 15:10:50 von mpeters

Mag Gam wrote:

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

CGI.pm is old and venerable. But it has a lot of cruft (HTML generation, etc).
Apache::Request is all about requesty things like GET/POST params, cookies, etc.
It is therefore much, much smaller memory wise. It's also much faster. So why
doesn't everyone use it? Well like you said, CGI is a standard Perl module. It's
everywhere that Perl is. Apache::Request needs to installed separately. And for
most applications the speed that A::R gives you won't really make that much
difference. Parameter parsing is almost never a bottleneck in a real application.

--
Michael Peters
Developer
Plus Three, LP

Re: CGI versus Apache::Request -- confusion

am 31.01.2008 17:57:42 von Anthony Gardner

--0-1458374047-1201798662=:89334
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit

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 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 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 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! - a smarter inbox.





Disclaimer: Technically, I'm always wrong!!

---------------------------------
Sent from Yahoo! - a smarter inbox.
--0-1458374047-1201798662=:89334
Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: 8bit

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 m
y 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 <magawake@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 <> wrote:
The request object is used in handlers. You can either write handlers or CGI scripts. Continue using CGI but inorder to reap the ben
ifits 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 <> 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 <
a href="http://us.rd.yahoo.com/mailuk/taglines/isp/control/*ht tp://us.rd.yahoo.com/evt=51949/*http://uk.docs.yahoo.com/mai l/winter07.html" target="_blank">Yahoo! - a smarter
inbox.




Disclaimer: Technically, I'm always wrong!!



Sent from - a smarter inbox.
--0-1458374047-1201798662=:89334--

Re: CGI versus Apache::Request -- confusion

am 01.02.2008 04:54:00 von Mag Gam

------=_Part_22728_29033794.1201838040631
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

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


On Jan 31, 2008 11:57 AM, Anthony Gardner 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 * 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
> 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 * 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!- a smarter inbox.
> >
>
>
>
>
> Disclaimer: Technically, I'm always wrong!!
>
> ------------------------------
> Sent from Yahoo!- a smarter inbox.
>

------=_Part_22728_29033794.1201838040631
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

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


On Jan 31, 2008 11:57 AM, Anthony Gardner <> 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 <> 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 <> 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 <> 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 - a smarter
inbox.




Disclaimer: Technically, I'm always wrong!!



Sent from - a smarter inbox.




------=_Part_22728_29033794.1201838040631--