Chapter 25. Programming for mod_perl 2.0
In this chapter, we discuss how to migrate services from mod_perl 1.0
to 2.0, and how to make the new services based on mod_perl 2.0
backward compatible with mod_perl 1.0 (if possible). We also cover
all the new Perl*Handlers in mod_perl 2.0.
Migrating to and Programming with mod_perl 2.0
In mod_perl 2.0, several configuration directives were renamed or removed. Several APIs also were changed, renamed, removed, or moved to new packages. Certain functions, while staying exactly the same as in mod_perl 1.0, now reside in different packages. Before using them, you need to find and load the new packages.
Since mod_perl 2.0 hasn’t yet been released as of this writing, it’s possible that certain things will change after the book is published. If something doesn’t work as explained here, please refer to the documentation in the mod_perl distribution or the online version at http://perl.apache.org/docs/2.0/ for the updated documentation.
The Shortest Migration Path
mod_perl 2.0 provides two backward-compatibility layers: one for the configuration files and the other for the code. If you are concerned about preserving backward compatibility with mod_perl 1.0, or are just experimenting with mod_perl 2.0 while continuing to run mod_perl 1.0 on your production server, simply enable the code-compatibility layer by adding:
use Apache2; use Apache::compat;
at the top of your startup file. Backward compatibility of the configuration is enabled by default.
Migrating ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access