in reply to Re^3: Stop fork in Parallel::ForkManager
in thread Stop fork in Parallel::ForkManager

You can also supply $pm->finish() with a parameter. I use it on my monitor scripts to keep track of how many successful connections to servers I've made. I return 0 for failure and 1 for success, so I just add them up and get 'X out of Y servers'. Works perfectly.

I don't know if you can return more than a scalar offhand, but if you could return any type of variable (array/hash/etc), it could be very useful for communicating between a child and parent process. It just doesn't help at all with child->child communication.
/\ Sierpinski
  • Comment on Re^4: Stop fork in Parallel::ForkManager

Replies are listed 'Best First'.
Re^5: Stop fork in Parallel::ForkManager
by Anonymous Monk on Sep 30, 2009 at 14:05 UTC
    I don't know if you can return more than a scalar offhand...

    Only an integer, since it is exit value. See forks :)