Beefy Boxes and Bandwidth Generously Provided by pair Networks Joe
Think about Loose Coupling
 
PerlMonks  

Re: opening '-|' on Windows

by jimbojones (Friar)
on Apr 15, 2005 at 20:22 UTC ( [id://448384]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to opening '-|' on Windows

Isn't the problem summarized in perlipc "Safe Pipe Opens"
Note that these operations are full Unix forks, which means they may not be correctly implemented on alien systems. Additionally, these are not true multithreading. If you'd like to learn more about threading, see the modules file mentioned below in the SEE ALSO section.
I don't think you can fork on Windows

- j

Replies are listed 'Best First'.
Re^2: opening '-|' on Windows
by Tanktalus (Canon) on Apr 15, 2005 at 21:54 UTC

    As stated above, I've found that fork is working (which was a surprise to me, too, until joining PM and being corrected on it myself ;->). But maybe -| isn't implemented.

      fork is emulated using threads but threads share file handles so you can't (without quite a bit more fakery being implemented) emulate pipes (between threads).

      You should be building around something portable like IPC::Run or IPC::Open3 instead.

      - tye        

        tye, thanks for pointing me there. Unfortunately, IPC::Run is a catch-22. I'm doing this to automatically install new modules, and using IPC::Run means I need to install it first. I've used IPC::Open3 in the past, and found it annoyingly complex, and thought I hit a gold mine with this new open :-) Guess not.

        Note that IPC::Open3's documentation, now that I'm looking at it again, explicitly says that "-|" doesn't work on Win32. That's unfortunate, but it shows more evidence that this is indeed the problem, and I need to work around it prior to further testing of my code.

        Thanks!

      Piped opens ("prog |" & "| prog") work, just not the '-|' varient. For some reason it has never been implemented.


      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      Lingua non convalesco, consenesco et abolesco.
      Rule 1 has a caveat! -- Who broke the cabal?
      Thanks for the updates. I'm learning all the time here ...

      - j

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://448384]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.