perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Geoffrey Young <ge...@modperlcookbook.org>
Subject Re: [PATCH] Apache::Test can never use mp1 with mp2 installed
Date Sat, 16 Jul 2005 01:21:15 GMT


Matt Sergeant wrote:
> There's a bug in Apache::Test that prevents it from working properly
> when you're trying to test something with mp1 when you've got mp2
> installed.
> 
> What happens is that Apache::TestConfig does this:
> 
> use constant IS_MOD_PERL_2       =>
>     eval { require mod_perl2 } || 0;
> 
> Which of course is wrong, that should be IS_MOD_PERL_2_INSTALLED for a
> start, but I haven't patched that.

:)

> 
> What then happens later is in TestRunPerl we do:
> 
>     if ($rev == 2) {
>         eval { require mod_perl2 };
>     } else {
>         eval { require mod_perl };
>     }
>     my $mp_ver = $mod_perl::VERSION;
> 
> Which now because mod_perl2 is already loaded, always returns the mp2
> version.

yah, ok.

> 
> Side comment: This stuff is a real maze of twisty passages - the only
> way I could find to debug this was to add Carp::cluck() to mod_perl2.pm
> so I knew what was loading it. I wish it were written a bit simpler.
> Maybe I'm underestimating the complexity of what it's trying to do.

Apache-Test is the best piece of software I've used lately.  it's also the
worst piece of software I've had to maintain lately :)

it really needs to be true OO and not, as you say, a maze of twisty
passages, with various "classes" magically adding foo to other "classes."
someday I'll re-attempt a complete OO rewrite from scratch when I have a
month of nothing to do :)


>      # sanity checking and loading the right mod_perl version
> +    delete $INC{'mod_perl.pm'};
>      if ($rev == 2) {
>          eval { require mod_perl2 };
>      } else {

applied, with comments.

thanks!

--Geoff

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


Mime
View raw message