You are in: > Home > Developers Guides
Perl - mod_perl

What is mod_perl?
mod_perl is at the heart of the Apache/Perl integration project, which brings together the full power of the Perl programming language and the Apache Web server.
From the outset, Apache was designed so that you can extend it by the addition of ``modules.'' Modules can do anything you need to do, such as rewrite HTTP requests, restrict access to certain pages and perform database lookups. Modules are normally written in C, which can be hard work. mod_perl is a module that allows you to do all of these things, and more, by using Perl -- making the development much quicker than C. Apache is the most popular Web server on the Internet and mod_perl is one of the most popular modules for extending it.
Why Is mod_perl So Popular?
If you love Perl and your favorite Web server is Apache, then you will love mod_perl at first sight. Once you try it in action, you will never look back -- you will find mod_perl has everything you need. But even if you do find that there is something missing, then just speak up. Before you can count to three, someone will have made it for you. Which, of course, will make you want to give something in return. Eventually you will contribute something on your own, and that will save time for a huge mod_perl community so that they can create even more things for others to use.
Simply install mod_perl and you have the full power of the Apache Web Server at your fingertips:
Accelerate your existing dynamic content
The standard Apache::Registry module can provide 100x speedups for your existing CGI scripts and reduce the load on your server at the same time. A few changes to the web server's config is all that is required to run your existing CGI scripts at lightning speed.
Easily create custom modules that become part of Apache
With mod_perl writing custom modules to extend and enhance Apache is a snap. Content handlers can be written in just a few lines of code and can be quickly integrated with existing modules specifically designed for use with mod_perl, or with modules freely available from the CPAN.
Gain access to all request stages
mod_perl is not only about super fast content generation. With mod_perl all phases of the request cycle can be accessed and controlled. No other web acceleration product gives you this much control.
Imagine the flexibility of rewriting URLs using Perl! Rewrite URLs based on the content of a directory structure, settings stored in a relational database, or the phase of the moon.
Write custom authentication and authorization modules to integrate with existing user databases or take advantage of the well-supported CPAN modules to extend the abilities of Apache. You can even create custom logging tailored to your site's specific needs.
Configure Apache with Perl
Perl can be used right in your httpd.conf file. Everything from virtual hosts to authentication settings can be configured via Perl. URL translation logic can be written with Perl for your complex or dynamic URL rewriting needs. Settings can be adjusted on a per-request basis and values passed from code in httpd.conf to your content generation modules. You can even generate complete HTTP output from the httpd.conf configuration file.
Install Third-party modules
Third-party modules give you application functionality such as sessions, passwords and database integration.
Application Frameworks
There are many high-level packages built on top of the mod_perl infrastructure to help you develop scalable and easily managed dynamic sites. All are well supported and maintain a loyal group of users.
You can select from a number of templating systems or application frameworks for use with mod_perl. See the mod_perl Products section for more information.
Apache 2.0 support
With mod_perl you can take advantage of the features of Apache 2.0. For example, custom protocol handlers can be written in Perl.
Related articles
- Perl - Downloading a URL with a script - [22nd Mar 2006]
- Perl - Pattern Matching (Regular Expressions) - [12th Jan 2006]
- Shell Scripting - Reading Variables From STDIN - [11th Jan 2006]
- Perl - Configuring and Starting the mod_perl Server - [06th Jan 2006]
- Perl - Installing mod_perl in Three Steps - [06th Jan 2006]
- Perl - mod_perl - [06th Jan 2006]
- Perl - Associative Arrays - [06th Jan 2006]
- Perl - Manipulating Arrays - [06th Jan 2006]
- Perl - Arrays - [06th Jan 2006]
- Perl - Operators - [06th Jan 2006]
- Perl - Scalar Variables - [06th Jan 2006]
- Shell Scripting - Introduction - [08th Dec 2005]
- Shell Scripting - Invoking Shell Scripts - [08th Dec 2005]
- Shell Scripting - Variables - [08th Dec 2005]
- Shell Scripting - Referencing Variables - [08th Dec 2005]
- Shell Scripting - Command Arguments - [08th Dec 2005]
- Shell Scripting - Language Constructs - [08th Dec 2005]
- Perl - Introduction - [06th Dec 2005]
- MySQL - Connecting to the server - [06th Dec 2005]
- MySQL - Introduction - [06th Dec 2005]







