Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
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":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (5)
As of 2024-03-29 10:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found