Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^3: What is the preferred cross-platform IPC module?

by BrowserUk (Pope)
on May 15, 2012 at 15:59 UTC ( #970667=note: print w/ replies, xml ) Need Help??


in reply to Re^2: What is the preferred cross-platform IPC module?
in thread What is the preferred cross-platform IPC module?

Take a look at winopen2() in Win32::SocketPair.


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
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.

The start of some sanity?


Comment on Re^3: What is the preferred cross-platform IPC module?
Download Code
Re^4: What is the preferred cross-platform IPC module?
by Theory (Beadle) on May 15, 2012 at 16:12 UTC
    I don't have Windows, and besides, that would completely defeat the purpose: I don't want to have to think about platform issues or any error-handling beyond trapping exceptions. I want a module that does all that for me. I like IPC::System::Simple, for example, which appears to do a nice job of it if all I want to do is system or backticks. IPC::Run may or may not succeed in doing it for interactive IPC, I'm still trying to figure that out.

      Sorry, for trying to help.

      My experiences of using IPC::Run on windows are dire. It is an over-engineered behemoth of a module that attempts to use *nix techniques to provide *nix capabilities on Windows, and fails dismally.

      The point about winopen2 is that it provides you with a pair of selectable handles connected to the child process' STDIN & STDOUT.

      As such, it is 'compatibile' with *nix-style code written using IPC::Open2 and select.

      Ie. you'd only need do something like:

      my( $in, $out ); if( $^O eq 'MSWin32' ) { ($in, $out ) = winopen2( $theCommand ); } else { open2( $in, $out, $theCommand ); } ... select .....

      But, its not in a module so ...


      With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
      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.

      The start of some sanity?

        I appreciate the help. That doesn't look bad, but then what does one do about error handling? Can errors from the child caught? At exec time? After that? That's what I imagine a module would take care of.

        I agree about IPC::Run. I am just surprised that there isn't a decent solution to this problem. Must come up all the bloody time…

      It seems to me that your response of

      besides, that would completely defeat the purpose: I don't want to have to think about platform issues

      conflicts with

      I started implementing the module I have been imagining,

      that was stated in the node that was being responded to.

      At least, I expect that creating a module that saves users from having to deal with "platform issues" that they would otherwise have to deal with pretty much requires that the author "think about [those] platform issues".

      - tye        

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://970667]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (14)
As of 2014-12-26 16:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (171 votes), past polls