perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <s...@stason.org>
Subject Re: [mp2 Patch] Simple changes to current Apache::Reload for mp1 & mp2
Date Thu, 19 Jun 2003 04:22:02 GMT
Philippe M. Chiasson wrote:
> 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.

you obviously haven't tested it with perl 5.005. what about the 'warnings' pragma?

I think Apache::Reload is simple enough to have two copies of it, adjusted for 
each mod_perl generation.

If we "hijack" Matt's distro and keep it as a separate module on CPAN, only 
syncing modperl and modperl-2.0 trees, then it's a whole different story. but 
again we hit this problem with PAUSE still not quite supporting bundling :(
(i.e. we don't want CPAN.pm to try to install mod_perl, when someone is trying 
to install Apache::Reload)

Proposal: keep the two separate for now, just make sure that the versions are 
different. For example 1.00 for mp1 and 2.00 for mp2. For the next release(s) 
hopefully PAUSE will support bundles and then we can decide how to act.

> 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);
>  
> 
> 


-- 


__________________________________________________________________
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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Mime
View raw message