in reply to Re^3: Can't spawn "cmd.exe":
in thread Can't spawn "cmd.exe":

Really?

C:\test\test\test>cmd "/C test.exe fred 3 1.2" 0 : test.exe 1 : fred 2 : 3 3 : 1.2

Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
"Too many [] have been sedated by an oppressive environment of political correctness and risk aversion."

Replies are listed 'Best First'.
Re^5: Can't spawn "cmd.exe":
by ikegami (Patriarch) on Mar 18, 2009 at 19:52 UTC
    Really.
    >cmd "/C dir" 'dir"' is not recognized as an internal or external command, operable program or batch file. >cmd /C dir Volume in drive C is C Volume Serial Number is 28AB-0E8B Directory of C:\Documents and Settings\ikegami 2009/03/18 03:49 PM <DIR> . 2009/03/18 03:49 PM <DIR> .. ...

    That's the one I had used to test earlier, but it turns out cmd is very forgiving for practically all other commands.

      Seems more like a bug in cmd.exe to me

      C:\test\test\test>cmd "/c dir *" Volume in drive C has no label. Volume Serial Number is 8C78-4B42 Directory of C:\test\test\test 18/03/2009 20:13 <DIR> . 18/03/2009 20:13 <DIR> .. ... C:\test\test\test>cmd "/c dir " Volume in drive C has no label. Volume Serial Number is 8C78-4B42 Directory of C:\test\test\test 18/03/2009 20:13 <DIR> . 18/03/2009 20:13 <DIR> .. ...

      One swallow does not a summer make :)


      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.

        One swallow does not a summer make :)

        Are you talking about dir being unique, or cmd being unique? :)

        I agree it's sensible to use system("cmd", $args). Note that it doesn't generalize to system($prog, $args). Try perl "-l foo.pl", for example.