I'm using IPC::Run as the basis for module that overrides system() allowing you to capture output from system() calls in modules you use. It seems to be working fine on Linux, and on Windows XP/Server 2003 it works for the system(@args) form of system. However, for system($mycommandandargsinonescalar) it will not work. It seems the problem is that when an IPC::Run harness is created with just a single scalar containing a whole command line, it splits up the command into an array of command and arguments and then prepends 'command', '/c' to this list. It appears it's trying to generate a windows shell oneliner. but on all of the XP and Server 2003 machines I have there is no shell named 'command', it's 'cmd', so when you try to run the harness thus created it fails, since there is no command 'command'.

I'd appreciate any insight into what's going on here. Did older windows OS's have a command shell named 'command'? Does anyone know of a good workaround to this problem?

Thanks,

--DrWhy

"If God had meant for us to think for ourselves he would have given us brains. Oh, wait..."


In reply to IPC::Run on WindowsXP/Windows Server 2003? by DrWhy

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.