in reply to Re: (tye)Re: 'system' not working!
in thread 'system' not working!

Okay, I even went out of my way and renamed some things so that I had spaces in my path but that didn't change my results. This type of stuff has changed between versions of Perl so perhaps that explains our different results. I was doing this testing using v5.6.0 ActivePerl build 616.

I suspect that Perl's 'if CreateProcess() fails, then just retry with CreateProcess("cmd.exe","/c ...",...)' logic is masking the real error here. I'd think that using an indirect object with system would disable that logic, but I haven't checked that.

In any case, you can always do:

use Win32; $vss= Win32::GetShortPathName( "D:\\Program Files\\" . "Microsoft Visual Studio\\Common\\VSS\\win32\\ss.exe");
and I'm pretty sure that will fix errors due to spaces in file names.

You also might want to try Win32::Process to see if you can reproduce why Perl thinks CreateProcess() is failing.

        - tye (but my friends call me "Tye")

Replies are listed 'Best First'.
Re: (tye)Re2: 'system' not working!
by John M. Dlugosz (Monsignor) on Oct 26, 2001 at 03:01 UTC
    This type of stuff has changed between versions of Perl so perhaps that explains our different results

    That pretty much conferms that it broke between versions, which is why my script no longer runs.

    I looked into the logic a short time ago when I posted the details of PERL5SHELL (or whatever it's called) for nonbeleivers. But that was after it already decided to use the shell.