Return-Path: Delivered-To: apmail-httpd-test-dev-archive@www.apache.org Received: (qmail 28911 invoked from network); 16 Apr 2004 18:34:01 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 16 Apr 2004 18:34:01 -0000 Received: (qmail 41760 invoked by uid 500); 16 Apr 2004 18:33:52 -0000 Delivered-To: apmail-httpd-test-dev-archive@httpd.apache.org Received: (qmail 41729 invoked by uid 500); 16 Apr 2004 18:33:51 -0000 Mailing-List: contact test-dev-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: test-dev@httpd.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list test-dev@httpd.apache.org Received: (qmail 41710 invoked from network); 16 Apr 2004 18:33:51 -0000 Received: from unknown (HELO mail.logilune.com) (195.154.174.52) by daedalus.apache.org with SMTP; 16 Apr 2004 18:33:51 -0000 Received: from stason.org (localhost.logilune.com [127.0.0.1]) by mail.logilune.com (Postfix) with ESMTP id 8C5391E1A0D for ; Fri, 16 Apr 2004 20:33:53 +0200 (CEST) Message-ID: <40802710.4010005@stason.org> Date: Fri, 16 Apr 2004 11:33:52 -0700 From: Stas Bekman Organization: Hope, Humanized User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040115 X-Accept-Language: en-us, en, he, ru MIME-Version: 1.0 To: test-dev@httpd.apache.org Subject: Re: qw() and embedded spaces in filname paths References: <407EFB0A.1070603@Golux.Com> <407FF470.4090607@modperlcookbook.org> In-Reply-To: <407FF470.4090607@modperlcookbook.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Geoffrey Young wrote: > > Rodent of Unusual Size wrote: > >>okey, bug found. noticed on windows because spaces in filenames >>are more common there, but it happens anywhere. >> >>here's the deal. this command: >> >>perl Makefile.PL -httpd "C:/A B/apache.exe" -apxs "C:/A B/apxs" >> >>results in the following being put into t/TEST >> >>%Apache::testConfig::Argv = qw(httpd C:\A B\apache.exe apxs C:\A B\apxs) >> >>so, duh, the spaces lose their significance because qw() is treating >>the whitespace as delimiters. > > > does this help? > > --Geoff > > > ------------------------------------------------------------------------ > > Index: lib/Apache/TestMM.pm > =================================================================== > RCS file: /home/cvs/httpd-test/perl-framework/Apache-Test/lib/Apache/TestMM.pm,v > retrieving revision 1.32 > diff -u -r1.32 TestMM.pm > --- lib/Apache/TestMM.pm 26 Mar 2004 01:17:08 -0000 1.32 > +++ lib/Apache/TestMM.pm 16 Apr 2004 14:56:45 -0000 > @@ -89,9 +89,11 @@ > my $body = "BEGIN { eval { require blib; } }\n"; > > $body .= Apache::TestConfig->modperl_2_inc_fixup; > - > - if (@Apache::TestMM::Argv) { > - $body .= "\n\%Apache::TestConfig::Argv = qw(@Apache::TestMM::Argv);\n"; > + > + foreach (@Apache::TestMM::Argv) { > + my ($key, $value) = @Apache::TestMM::Argv[0,1]; > + $body .= "\n\$Apache::TestConfig::Argv{'$key'} = '$value';\n"; > + splice(@Apache::TestMM::Argv,0,2) > } or a simpler: Index: lib/Apache/TestMM.pm =================================================================== RCS file: /home/cvs/httpd-test/perl-framework/Apache-Test/lib/Apache/TestMM.pm,v retrieving revision 1.32 diff -u -r1.32 TestMM.pm --- lib/Apache/TestMM.pm 26 Mar 2004 01:17:08 -0000 1.32 +++ lib/Apache/TestMM.pm 16 Apr 2004 18:28:28 -0000 @@ -91,7 +91,9 @@ $body .= Apache::TestConfig->modperl_2_inc_fixup; if (@Apache::TestMM::Argv) { - $body .= "\n\%Apache::TestConfig::Argv = qw(@Apache::TestMM::Argv);\n"; + $body .= "\n\%Apache::TestConfig::Argv = (" . + join( "," map qq["$_"], @Apache::TestMM::Argv) . + ");\n"; } my $in = Symbol::gensym(); this patch simply quotes the arguments, leaving things as before. In case of Geoff's patch, it's simpler to write it as: if (@Apache::TestMM::Argv) { while (my ($k, $v) = splice @Apache::TestMM::Argv, 0, 2) { $body .= "\n\$Apache::TestConfig::Argv{'$key'} = '$value';\n"; } } Either way is fine with me. __________________________________________________________________ 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