in reply to Re^3: Windows: system() and PAUSE
in thread Windows: system() and PAUSE

Which build of AS?
This is perl, v5.8.8 built for MSWin32-x86-multi-thread (with 18 registered patches, see perl -V for more detail) Copyright 1987-2007, Larry Wall Binary build 822 280952 provided by ActiveState http://www.ActiveState.com Built Jul 31 2007 19:34:48
perl -we"system qw cmd /c pause ;"
Does not work.
perl -we"system qw cmd.exe /c pause ;"
Works.

AHA!!!!!

But I checked my PATH, and there is only cmd.exe in the PATH, no cmd.bat, cmd.com, cmd.cmd .... And I changed my PATH so that it only contained the Perl bin directory, and C:\WINNT\system32, and the error still occurs.
perl -we"system 'cmd /c pause';"
Does not work.

-- 
Ronald Fischer <ynnor@mm.st>

Replies are listed 'Best First'.
Re^5: Windows: system() and PAUSE
by ikegami (Patriarch) on Apr 12, 2010 at 16:00 UTC

    It's acting as if Perl removes any "cmd /c " prefixing the composed command. Maybe it's an attempt to fix the bug where the shell is called when it shouldn't on Windows. Deviations (such as adding .exe) fool the code in question.

    I can't replicate the problem with builds 817 and 824. AS doesn't offer old builds anymore, so I can't try 822.

Re^5: Windows: system() and PAUSE
by Anonymous Monk on Apr 12, 2010 at 13:45 UTC
    first it look for cmd.com, then cmd.exe, then cmd.bat, then cmd.cmd ..... PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH