From: Nicholas Clark Date: Fri, 9 Oct 2009 20:12:16 +0000 (+0200) Subject: Make _quote_args() return a result, rather than passing it a scalar reference. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=1cce9906401b8a2db10f2d0061757627ad69f138;p=p5sagit%2Fp5-mst-13.2.git Make _quote_args() return a result, rather than passing it a scalar reference. This was the only use of scalar references in test.pl, and the only use of \ to create a reference to a scalar. We are now more robust in the face of parser or runtime bugs. --- diff --git a/t/test.pl b/t/test.pl index ca63a76..1c1a09d 100644 --- a/t/test.pl +++ b/t/test.pl @@ -415,8 +415,9 @@ sub _quote_args { # In VMS protect with doublequotes because otherwise # DCL will lowercase -- unless already doublequoted. $_ = q(").$_.q(") if $is_vms && !/^\"/ && length($_) > 0; - $$runperl = $$runperl . ' ' . $_; + $runperl = $runperl . ' ' . $_; } + return $runperl; } sub _create_runperl { # Create the string to qx in runperl(). @@ -436,7 +437,7 @@ sub _create_runperl { # Create the string to qx in runperl(). local $Level = 2; die "test.pl:runperl(): 'switches' must be an ARRAYREF " . _where() unless ref $args{switches} eq "ARRAY"; - _quote_args(\$runperl, $args{switches}); + $runperl = _quote_args($runperl, $args{switches}); } if (defined $args{prog}) { die "test.pl:runperl(): both 'prog' and 'progs' cannot be used " . _where() @@ -479,7 +480,7 @@ sub _create_runperl { # Create the string to qx in runperl(). } } if (defined $args{args}) { - _quote_args(\$runperl, $args{args}); + $runperl = _quote_args($runperl, $args{args}); } $runperl = $runperl . ' 2>&1' if $args{stderr}; if ($args{verbose}) {