Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^2: Push it real good, or don't

by pimperator (Acolyte)
on Jun 09, 2014 at 20:16 UTC ( [id://1089321] : note . print w/replies, xml ) Need Help??


in reply to Re: Push it real good, or don't
in thread Push it real good, or don't

Ahhh I think this is the issue at hand. How do I solve it?

Replies are listed 'Best First'.
Re^3: Push it real good, or don't
by Laurent_R (Canon) on Jun 09, 2014 at 20:56 UTC
    Not necessarily the best answer, but one way to do it is for the child to write to a file and the parent to read it. But that is just an idea on how to do it, I am far from being an expert on these things.
Re^3: Push it real good, or don't
by boftx (Deacon) on Jun 09, 2014 at 20:21 UTC

    Well, the first question is this: Do you really need to run this as a forked process?

    You must always remember that the primary goal is to drain the swamp even when you are hip-deep in alligators.
      Yes this is a test for a much larger script

        The best advice I can give you (other than giving you working code) is to do a search for socketpair. You will find lots of examples of how to get data back from a child process.

        Update: The latest version of Parallel::ForkManager has a mechanism that is based on files. I would use that only as a last resort. It appears to be horribly slow and adds many more potential failure points.

        You must always remember that the primary goal is to drain the swamp even when you are hip-deep in alligators.
        Did you try reading the fine manual of Parallel::ForkManager ?

        Cheers Rolf

        (addicted to the Perl Programming Language)