httpd-apreq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <s...@stason.org>
Subject Re: Makefile.PL patch for compilation on HP-UX
Date Thu, 06 Feb 2003 02:30:39 GMT
Randy Kobes wrote:
> On Thu, 6 Feb 2003, Stas Bekman wrote:
> 
> 
>>Index: Makefile.PL
>>===================================================================
>>RCS file: /home/cvs/httpd-apreq/Makefile.PL,v
>>retrieving revision 1.17
>>diff -u -r1.17 Makefile.PL
>>--- Makefile.PL	24 Dec 2002 06:45:04 -0000	1.17
>>+++ Makefile.PL	5 Feb 2003 22:33:11 -0000
>>@@ -3,6 +3,16 @@
>>  use FindBin;
>>  use 5.005;
>>
>>+use File::Path qw(mkpath);
>>+
>>+use mod_perl;
> 
> 
> Or perhaps 'require mod_perl', so that the 'die' statements below
> have a chance to give an informative message? Or even wrap it in
> an eval, so that if mod_perl's not present, a suitable message
> can be given?

what difference would it make, unless you put the require in eval {} block? 
You need mod_perl anyways, so if you don't have it, you need to get. If you do 
have it, we check for the version.

>>+if ($mod_perl::VERSION < 1.2402) {
>>+    die "Please upgrade mod_perl to 1.24_02 or greater";
>>+}
>>+elsif ($mod_perl::VERSION > 1.98) {
>>+    die "mod_perl 1.x is required";
>>+}

So if we want to be more helpful, on the first problem (not having mod_perl at 
all). perhaps the best would be:

BEGIN {

   unless (eval {require mod_perl}) {
       die "Please install mod_perl: 1.25 < version < 1.99 ($@)";
   }
   if ($mod_perl::VERSION < 1.2402) {
       die "Please upgrade mod_perl to 1.24_02 or greater";
   }
   elsif ($mod_perl::VERSION > 1.98) {
       die "mod_perl 1.x ( < 1.99) is required";
   }

}



__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


Mime
View raw message