in reply to Forkin around
How can I, prior to having $pid set in the fork, make the block that loads @hosts execute only in the parent?
Of course you know that prior to the fork the children do not exist, and that none of the work that was done before the fork takes place is redone by the children. At child process begins life with an exact duplicate of the state of the parent. So the @hosts array was loaded by the parent and only by the parent.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Forkin around
by gnu@perl (Pilgrim) on Dec 12, 2002 at 21:02 UTC |