Nicholas Clark wrote:
> On Tue, Aug 26, 2008 at 02:30:47PM +0100, Steve Hay wrote:
>> Nicholas Clark wrote:
> 
>>> Odd. So try something else: If you change t/op/local.t from
>>> 
>>> like( runperl(stderr => 1,
>>>               prog => 'use constant foo => q(a);' .
>>>                       'index(q(a), foo);' .
>>>                       'local *g=${::}{foo};print "ok";'), "ok",
>>> "[perl #52740]"); 
>>> 
>>> to
>>> 
>>> like( runperl(stderr => 1,
>>>               prog => 'use constant foo => q(a);' .
>>>                       'index(q(a), foo);' .
>>>                       'local *g=${::}{foo};print "ok\n";'), "ok",
>>> "[perl #52740]"); 
>>> 
>>> 
>>> does that make t/op/local.t pass?
>> 
>> No, it didn't. But #34228 does.
>> 
>> It seems that runperl() is a little flaky when it comes to handling
>> quotes in different shells. Perhaps it is best to always use q() and
>> qq().
> 
> Yes. I wondered that. But I looked at the code and thought that it
> was always using a temporary file. Hence I didn't try committing that
> change blind yesterday.
> 
> I wonder what I missed.

It's in _create_runperl() isn't it?

If you pass a prog, then it sets

$args{progs} = [$args{prog}]

and then, since you now have progs, it builds a command from a series of
-e options:

        foreach my $prog (@{$args{progs}}) {
            if ($is_mswin || $is_netware || $is_vms) {
                $runperl .= qq ( -e "$prog" );
            }
            else {
                $runperl .= qq ( -e '$prog' );
            }
        }


> 
> (And if it was using -e, I was going to make test.pl default to
> warning if it found ' or " with an option to turn that warning off)

If you do, then a warning about embedded newlines would also be useful.
That's tripped me up a couple of times, e.g.

http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2006-07/msg00727.
html
http://public.activestate.com/cgi-bin/perlbrowse/p/31985

Reply via email to