perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Philippe M. Chiasson" <go...@cpan.org>
Subject [mp2 Patch] Simple changes to current Apache::Reload for mp1 & mp2
Date Wed, 18 Jun 2003 05:18:35 GMT
I needed this simple patch to get Apache::Reload working in mp1.

Any objections to at least applying this so it is ready for possible
inclusion in mp1's upcoming release?

Of course, if Steve Hay's suggestions make it through, keeping the
backwards compatibility would become important as well.

Gozer out.

Index: lib/Apache/Reload.pm
===================================================================
RCS file: /home/cvs/modperl-2.0/lib/Apache/Reload.pm,v
retrieving revision 1.11
diff -u -I$Id -r1.11 Reload.pm
--- lib/Apache/Reload.pm	3 Jun 2003 00:09:04 -0000	1.11
+++ lib/Apache/Reload.pm	18 Jun 2003 05:16:07 -0000
@@ -3,15 +3,23 @@
 use strict;
 use warnings FATAL => 'all';
 
-use mod_perl 1.99;
+use mod_perl;
 
-our $VERSION = '0.09';
+use constant MOD_PERL2 => $mod_perl::VERSION >= 1.99;
 
-use Apache::Const -compile => qw(OK);
+our $VERSION = '0.09';
 
-use Apache::Connection;
-use Apache::ServerUtil;
-use Apache::RequestUtil;
+if (MOD_PERL2) {
+    require Apache::Const;
+    Apache::Const->import(qw(OK));
+    require Apache::Connection;
+    require Apache::ServerUtil;
+    require Apache::RequestUtil;
+}
+else {
+    require Apache::Constants;
+    Apache::Constants->import(qw(OK));
+}
 
 use vars qw(%INCS %Stat $TouchTime %UndefFields);
 


-- 
--------------------------------------------------------------------------------
Philippe M. Chiasson /gozer\@(cpan|ectoplasm)\.org/ 88C3A5A5 (122FF51B/C634E37B)
http://gozer.ectoplasm.org/    F9BF E0C2 480E 7680 1AE5 3631 CB32 A107 88C3 A5A5
Q: It is impossible to make anything foolproof because fools are so ingenious.
perl -e'$$=\${gozer};{$_=unpack(P7,pack(L,$$));/^JAm_pH\n$/&&print||$$++&&redo}'


Mime
View raw message