Maybe this abstraction do the job....

mod_perl packages (or classes) binds with HTTP server process. 
Basically there is a perl interpreter loaded along with HTTP code
and running in memory....the customer of mod_perl then loads additional
perl code to alter the behavior of the HTTP server. The word 'alter' can
be replaced with 'overload' or 'override' as well. As such, this customer
would need to be aware of how the HTTP server is written. Sort of like
writing an installable device driver. 

So now that your class (or package) is loaded and running along with the
HTTP server, you can do many things, including crashing the HTTP server,
just like a bad device driver. But on a good day, your package should 
have a handler (simply a function) that will be called (invoked) when
certain events happen (an event is also a state, in which the HTTP server
is). So now the thread of control is given to your package. Now you can
do whatever. But whatever you do, you need to be in harmony with the 
rest of the HTTP cycle. And your day will end nicely, else you'll be
drinking lots coffee...just like hacking with any kernel...

Having said that....I recommend "Writing Apache Modules with Perl and C"
known as the 'eagle book'. See Chapter 3, 'The Apache Module Architecture
and API' and for  a quick feeling, see Figure 3-3, page 60, "The Request
Loop".

Of course I'm new to mod_perl, so if Pokymon Masters find me in fault,
please train me as I want to be the best pokymon trainer...yes I got a 
four-year old...

Good luck...

On Thu, 6 Sep 2001, Ken Williams wrote:

> Hi,
> 
> It sounds like you want to read the source code. =)  Download mod_perl 
> (or perhaps you already have) and read the source to Apache.pm, 
> mod_perl.pm, and so on, until you understand everything you want to.  Be 
> warned, it's not easy reading.
> 
> There aren't many documents describing the internals of mod_perl, because 
> the internals are subject to change, and the user generally shouldn't be 
> concerned with what's going on there (unless they want to read the 
> source).
> 
> Murugan K <[EMAIL PROTECTED]> wrote:
> 
> > Hi
> > In the CGI  environment ,
> >     After getting the request from the client  , based on the request
> > the web server will load the cgi2perl  module   ( may be someother
> > name)  to act as interface between perl and Webserver.  The cgi2perl
> > will get the data from perl interpreter and give back to web server.
> > This is the way it will work in cgi environment . The cgi2perl module
> > will use the webserver API functions to interact with webserver.
> >
> > Like that , i want to understand how internally mod_perl is working
> > apart from generic explanations. Where to get all those informations.
> >
> > Thanks in advance.
> >
> > Regards
> > K.Murugan
> >
> >
> 
> 
> 

-- 
-------------------------------------------------------------------------
Medi Montaseri                               [EMAIL PROTECTED]
Unix Distributed Systems Engineer            HTTP://www.CyberShell.com
CyberShell Engineering
-------------------------------------------------------------------------

Reply via email to