www.opensourcewebbook.com
 
     
  Page Path - Contents - mod_perl  
     
 
Home
About
Foreword
Reviews
Authors
Purchase
Errata
Sourcecode
Resources
Tools
Contents
Linux
Apache
Perl
MySQL
WML
CGI
mod_perl
SSI
Embperl
Mason
PHP
     

mod_perl

mod_perl is another, better way to create dynamic web pages. It is faster and far more flexible than CGI and has the advantage of being based on Perl. Thus it provides the dual benefit of building on the knowledge base you've gained by studying Perl, and taking advantage of the entire Perl base.

mod_perl is a fully functional Perl interpreter embedded in the Apache Web server, making the Perl interpreter always available for CGI programs - there is no extra step to load Perl into memory. Also, mod_perl is smart enough to cache CGI programs in memory, so if a CGI program is run multiple times, it is compiled only onece. The result is a considerable improvement in speed.

Speed is not the only advantage of mod_perl. It also gives you increased power, flexibility, and the ability to customize Apache. Because Perl is built into Apache, Perl is available to the server at all times. So you can write Perl code that performs customized processing during any phase of Apache's processing, from the request phase to the authentication phase to the logging phase (to name just a few).

mod_perl Links

mod_perl home page
mod_perl guide
Writing Apache Modules with Perl and C web site

 

     

EXAMPLES:

Startup Configuration File
startup.pl

Apache::Registry
hello.cgi
hello.cgi contents

hitit.pl contents
hitit2.pl contents

info4.cgi
info4.cgi contents

nameage.html
nameage.html contents
nameage.cgi contents

Pure mod_perl
/helloworld
HelloWorld.pm

/cgidata
HandleCGIData.pm

/cgidata2
HandleCGIData2.pm

/pathinfo/hello/world
PathInfo.pm

mod_perl Project
book.pl

/booklisting
/bookdetail
BookListing.pm
BookDetail.pm
BookMailLog.pm

/booklistingmysql
/bookdetailmysql
BookListingMysql.pm
BookDetailMysql.pm
BookMailLog.pm