in reply to Re: IPC::Run on Windows, path separator
in thread IPC::Run on Windows, path separator

Its invoking the shell
I would not expect that it does. From the perldocs:

# Launch a sub process directly, no shell. Can't do redirectio +n # with this form, it's here to behave like system() with an # inverted result. $r = run "cat a b c" ;
So this example explicitly says no shell.

-- 
Ronald Fischer <ynnor@mm.st>

Replies are listed 'Best First'.
Re^3: IPC::Run on Windows, path separator
by ikegami (Patriarch) on May 27, 2010 at 14:54 UTC
    system calls the shell when it's documented not to in Windows. According to the documentation, perl -e"system('dir')" and perl -e"system('foo.bat')" should fail, yet both work. This might be documented in perlport.

      Please call for the documentation to change, not the implementation. It's a few little details like this that make perl usable on windows.

        Whatever we think of it, we're stuck with it because of backwards compatibility reasons. Note that

        system { $cmd[0] } @cmd;

        appears to work as documented, except for the error code.

      Indeed! OTOH, IPC::Run::run(['echo xxx']) fails....

      -- 
      Ronald Fischer <ynnor@mm.st>
Re^3: IPC::Run on Windows, path separator
by Anonymous Monk on May 27, 2010 at 14:45 UTC
    You're giving it a batch file, and only the shell runs batch files, so both the following lines work for me
    IPC::Run::run(['C:/perl/5.10.1/bin/MSWin32-x86-multi-thread/perl.EXE', + qw! -e die(666) !]) ; IPC::Run::run(['C:\perl\5.10.1\bin\MSWin32-x86-multi-thread\perl.EXE', + qw! -e die(666) !]) ;
      Good point! Thanks a lot!

      -- 
      Ronald Fischer <ynnor@mm.st>