my $src = Apache::src->new;
for my $path ($src->find) { my $mmn = $src->module_magic_number($path); my $v = $src->httpd_version($path); next unless $v; print "path = $path ($mmn,$v)\n"; my $dir = $src->prompt("Configure with $path?"); }
Apache::src - Methods for locating and parsing bits of Apache source code
use Apache::src (); my $src = Apache::src->new;
This module provides methods for locating and parsing bits of Apache source code.
Create an object blessed into the Apache::src class.
Top level directory where source files are located.
my $dir = $src->dir; -d $dir or die "can't stat $dir $!\n";
Apache's source tree was reorganized during development of version 1.3. So, common header files such as httpd.h are in different directories between versions less than 1.3 and those equal to or greater. This method will return the right directory.
httpd.h
Example:
-e join "/", $src->main, "httpd.h" or die "can't stat httpd.h\n";
Searches for apache source directories, return a list of those found.
for my $dir ($src->find) { my $yn = prompt "Configure with $dir ?", "y"; ... }
Print include paths for MakeMaker's INC argument to WriteMakefile.
WriteMakefile
use ExtUtils::MakeMaker; use Apache::src (); WriteMakefile( 'NAME' => 'Apache::Module', 'VERSION' => '0.01', 'INC' => Apache::src->new->inc, );
Return the MODULE_MAGIC_NUMBER defined in the apache source.
my $mmn = $src->module_magic_number;
Return the server version.
my $v = $src->httpd_version;
Doug MacEachern
1 POD Error
The following errors were encountered while parsing the POD:
=pod directives shouldn't be over one line long! Ignoring all 8 lines of content
To install mod_perl, copy and paste the appropriate command in to your terminal.
cpanm
cpanm mod_perl
CPAN shell
perl -MCPAN -e shell install mod_perl
For more information on module installation, please visit the detailed CPAN module installation guide.