Preparing mod_perl modules for CPAN (original) (raw)
Table of Contents
- Description
- Defining Makefile.PL Prerequisites that Require mod_perl
- Writing the Test Suite
- Maintainers
- Authors
Description
This document provides information for CPAN modules developers whose modules require mod_perl.
Defining Makefile.PL Prerequisites that Require mod_perl
If there are any prerequisites that need to be defined in_Makefile.PL_, but require a mod_perl environment to successfully get loaded, the following workaround can be used. The following example will specify two prerequisites: CGI.pm
and Apache::DBI
, 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 Can't locate object method is a part of the error generated when Apache::DBI
is installed but is attempted to be loaded outside of mod_perl, e.g. at the command line, which is the case with Makefile.PL.
Maintainers
Maintainer is the person(s) you should contact with updates, corrections and patches.
Stas Bekman [http://stason.org/]
Authors
- Stas Bekman [http://stason.org/]
Only the major authors are listed above. For contributors see the Changes file.