Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^3: Is there a problem with IPC::Open on Windows 7?

by ikegami (Pope)
on Aug 10, 2013 at 19:53 UTC ( #1048937=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Is there a problem with IPC::Open on Windows 7?
in thread Is there a problem with IPC::Open on Windows 7?

The design isn't broken either. It's perfectly simple and makes sense.

open(\*IN, \*OUT, \*ERR, ...) # Get three pipes back open(\*IN, \*OUT, undef, ...) # Get two pipes back, # one catches both STDOUT and STDERR

It's using lexicals that causes problems. This module predates lexicals.


Comment on Re^3: Is there a problem with IPC::Open on Windows 7?
Download Code
Re^4: Is there a problem with IPC::Open on Windows 7?
by BrowserUk (Pope) on Aug 11, 2013 at 05:03 UTC
    It's using lexicals that causes problems. This module predates lexicals.

    13 years on and it doesn't support lexicals. is 'Broken by Design'.

    And even if you use globs, there is no sensible way to use the 3 handle version on windows because select doesn't work on file handles.

    Even the documentation is sorely lacking.

    At the very least there should be a big, clear warning "Doesn't work with lexicals" in the warnings section. The bland parenthetical "(this means that an autovivified lexical cannot be used for the STDERR filehandle, see SYNOPSIS)" is hardly adequate given the nature of the limitation and the module's raison d'etre.

    The discussion regarding the likelihood of deadlocking when trying to process two concurrent asynchronous streams is also woefully inadequate.

    The modules place in the core and frequent recommendations, bely the difficulty of its practical use; which is further compounded by the lack of discussion of those difficulties, and examples of working around them.


    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.

      Maybe a bug opened to update the documentation would be a good idea? There are couple of workarounds for IPC::Open3, but none seems to be able to reach core.

      Anyway, it seems to be possible to dup() sockets under MS Windows and use select() over them, but as I replied before, I need to do more tests with it.

      Alceu Rodrigues de Freitas Junior
      ---------------------------------
      "You have enemies? Good. That means you've stood up for something, sometime in your life." - Sir Winston Churchill
        it seems to be possible to dup() sockets under MS Windows and use select()

        Really? How would that work?

        To the best of my knowledge -- which I thought was pretty good on this subject -- Perl's select is implemented in terms of the winSock select() function which will always return WSAENOTSOCK if any of the descriptors in the set is not a socket.


        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.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (3)
As of 2014-07-29 01:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (211 votes), past polls