Eric Wilhelm wrote:
> # from [EMAIL PROTECTED]
> # on Thursday 18 September 2008 03:16:
> 
>> +  if ($status and $! =~ /Argument list too long/i) {
>> +    my $env_entries = '';
>> +    foreach (sort keys %ENV) { $env_entries .=
>> "$_=>".length($ENV{$_})."; " } +    warn "'Argument list' was 'too
>> long', env lengths are $env_entries"; +  }
> 
> That chunk probably shouldn't be in the win32 code ;-)  A: we should fix 
> the PERL5LIB problem and  B: I don't think that kernel has the same 
> error message as redhat.

No perl-specific code should be in do_system().  do_system() should not be
making assumptions about what sort of command it's running.  Push it up into
the run_perl* methods.

run_perl_command() already does muckery, not good that it's done in two places.

Why is it necessary to protect against long @INC anyway?  We're only setting
our additions to @INC, not everything in the stock @INC.


> As for the rest, it's possible that we're just as well to do the quoting 
> and run system($scalar) here, but we could possibly still keep it as a 
> list.  I think win32/win32.c implies that it does get to the win32 api 
> as a list, but I'm not sure.
> 
>   system($^X, '-e', '"print \\"hello world!\n\\""');
> 
> So if it has ", then it has to be wrapped in ", and then any " have to 
> be \", but also any literal \ preceding a " needs to become \\\".

That works.  Then again, oneliner() also works so I'd just as soon leave it.
Anyhow, if you break it again you get to fix it this time.  It's late and
there's more bugs.


-- 
31. Not allowed to let sock puppets take responsibility for any of my
    actions.
    -- The 213 Things Skippy Is No Longer Allowed To Do In The U.S. Army
           http://skippyslist.com/list/

Reply via email to