Return-Path: Delivered-To: apmail-perl-dev-archive@www.apache.org Received: (qmail 17336 invoked from network); 16 Jul 2005 01:21:32 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 16 Jul 2005 01:21:32 -0000 Received: (qmail 74646 invoked by uid 500); 16 Jul 2005 01:21:25 -0000 Delivered-To: apmail-perl-dev-archive@perl.apache.org Received: (qmail 73747 invoked by uid 500); 16 Jul 2005 01:21:23 -0000 Mailing-List: contact dev-help@perl.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list dev@perl.apache.org Received: (qmail 73722 invoked by uid 99); 16 Jul 2005 01:21:22 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 15 Jul 2005 18:21:22 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [66.77.29.165] (HELO secure.exclamationlabs.net) (66.77.29.165) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 15 Jul 2005 18:21:19 -0700 Received: from [192.168.2.160] (pcp0010804675pcs.walngs01.pa.comcast.net [69.142.163.148]) (authenticated (0 bits)) by secure.exclamationlabs.net (8.11.6/8.11.6) with ESMTP id j6G1LMs31408; Fri, 15 Jul 2005 20:21:22 -0500 Message-ID: <42D8610B.6020908@modperlcookbook.org> Date: Fri, 15 Jul 2005 21:21:15 -0400 From: Geoffrey Young User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040927 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Matt Sergeant CC: mod_perl Dev , modperl@perl.apache.org Subject: Re: [PATCH] Apache::Test can never use mp1 with mp2 installed References: In-Reply-To: X-Enigmail-Version: 0.86.1.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N 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