Can anyone find me a compelling argument not to do this

Tongue-in-cheek answers: Because having another module to do "system" doesn't actually make things simpler? Because having yet another special case of how things work on Windows doesn't make things simpler?

In seriousness, I'm all for better portability and a friendlier API than "system", but this has been attempted so many times that I'd really rather see an attempt to bring together the best insights or try to merge new insights into one of the stronger existing modules than see an attempt to create yet another "special case". (See module list that follows.)

Personally, I tend to favor IPC::Run3, but only because I've used it the most and had few problems with it across unix and Win32.

Moreover, attempting to emulate Unix "system" behavior on Win32 strikes me as potentially quite tricky given all the special cases that had to be built into "system" on Win32 in the first place.

For example, you suggest that a multi-arg list never be passed to the shell. So how would you replace/handle this call to "system":

system("echo", "%PATH%"); # works fine on Win32

On Win32, echo is a built-in command and has to be passed to cmd.exe and "%PATH%" does environment variable expansion (at some point anyway -- I think on the command line, but I'm not entirely sure. That works with "system" but I don't think it necessarily would with your "run" in IPC::System::Simple.

Anyway, as you develop these ideas further, I encourage you to post them on http://win32.perl.org so that all may benefit.

c.f other docs and modules (including ones I know and others that I just found searching on CPAN):

-xdg

Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.


In reply to Re: RFC: IPC::System::Simple under Win32 by xdg
in thread RFC: IPC::System::Simple under Win32 by pjf

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.