Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

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

by BrowserUk (Pope)
on Aug 11, 2013 at 05:03 UTC ( #1048974=note: print w/ replies, xml ) Need Help??


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

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.


Comment on Re^4: Is there a problem with IPC::Open on Windows 7?
Re^5: Is there a problem with IPC::Open on Windows 7?
by glasswalk3r (Pilgrim) on Aug 12, 2013 at 18:07 UTC

    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.
        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.

        I'm not a MS Windows specialist and I cannot give all the details of how it works since I copying implementation code from others, but so far it is working 100% for STDOUT, and some initial testing for STDERR is looking good too.

        Here is one implementation which I based mine: https://github.com/lucastheisen/ipc-open3-callback

        And here is my implementation (take a look at Siebel::Srvrmgr::Daemon run() method and Test::Siebel::Srvrmgr::Daemon runs_with_stderr() method): http://code.google.com/p/siebel-monitoring-tools/source/browse/

        Specific to the runs_with_stderr method, the test is not complete (the return code is being get from the Log::Log4perl log method) but if you keep the default logger configuration (see Siebel::Srvrmgr) you will get the STDERR from the srvrmgr-mock.pl script (included in the distribution).

        Alceu Rodrigues de Freitas Junior
        ---------------------------------
        "You have enemies? Good. That means you've stood up for something, sometime in your life." - Sir Winston Churchill

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (8)
As of 2014-08-28 03:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (255 votes), past polls