=head1 NAME Preparing mod_perl modules for CPAN =head1 Description This document provides information for CPAN modules developers whose modules require mod_perl. =head1 Defining Makefile.PL Prerequisites that Require mod_perl If there are any prerequisites that need to be defined in I, but require a mod_perl environment to successfully get loaded, the following workaround can be used. The following example will specify two prerequisites: C and C, the latter can be loaded only under mod_perl whereas the former can be loaded from the command line. file:Makefile.PL ---------------- use ExtUtils::MakeMaker; # set prerequisites my %prereq = ( 'CGI' => 2.71, ); # Manually test whether Apache::DBI is installed and add it to the # PREREQ_PM if it's not installed, so CPAN.pm will automatically fetch # it. If Apache::DBI is already installed it will fail to get loaded by # MakeMaker because it requires the mod_perl environment to load. eval { require Apache::DBI }; if ($@ && $@ !~ /Can't locate object method/) { $prereq{'Apache::DBI'} = 0.87; } WriteMakefile( NAME => 'Apache::SuperDuper', VERSION_FROM => 'SuperDuper.pm', PREREQ_PM => \%prereq, # ... the rest ); Notice that I is a part of the error generated when C is installed but is attempted to be loaded outside of mod_perl, e.g. at the command line, which is the case with I. =head1 Writing the Test Suite The C framework provides an easy way to test modules which require mod_perl (or Apache in general), be it 1.0 or 2.0 generation. Here is L framework|docs::general::testing::testing>. =head1 Maintainers Maintainer is the person(s) you should contact with updates, corrections and patches. Stas Bekman [http://stason.org/] =head1 Authors =over =item * Stas Bekman [http://stason.org/] =item * =back Only the major authors are listed above. For contributors see the Changes file. =cut