redhotpenguin has asked for the wisdom of the Perl Monks concerning the following question:
This is my latest attempt at a Makefile.PL section that invokes Apache::Bootstrap or exits with exit code 255. The intent is that if Apache::Bootstrap is not installed, the Makefile.PL dies with code 255, the same error number returned to the shell as if 'use 5.8.8;' failed in Makefile.PL.
I'm mainly looking for feedback on this code. The reasons that I need to do what I'm doing may not be all that clear, but I need to use either ExtUtils::MakeMaker or ModPerl::Build::MM, and that depends on the versions of mod_perl (if any) that are installed.
#!/usr/bin/perl use strict; use warnings; ################################### # minimum version of A::B required my $ab = 0.06; eval { require Apache::Bootstrap }; ($@ or ($Apache::Bootstrap::VERSION < $ab)) && do { $! = 255; die("Apache::Bootstrap $ab required"); }; # make sure we have at least one minimum version of mod_perl my $bs = eval { Apache::Bootstrap->new({ mod_perl2 => 1.99022, mod_perl => 1.30 }) }; do { $! = 255; die($@); } if $@; ################################################# # use $bs to determine whether ExtUtils::MakeMaker # or ModPerl::Build::MM should be used to write # the Makefile
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Bootstrapping Makefile.PL with Apache::Bootstrap
by Anonymous Monk on Apr 28, 2009 at 06:33 UTC | |
by redhotpenguin (Deacon) on Apr 28, 2009 at 07:51 UTC | |
by Anonymous Monk on Apr 28, 2009 at 09:00 UTC |