in reply to How to run the child process parellel to the parent process with fork

From your example, you will not know the order of the processes. If you replace (1..3) with (1..1000), ie make the parent run longer, you will find that the printout from the child is somewhere in the middle. From which I conclude that the processes run in parallel.

At least this is what happens on my Windows machine with ActivePerl.

You might also want to switch on autoflush to make sure the output from print reaches the screen when it is executed: $|=1;

  • Comment on Re: How to run the child process parellel to the parent process with fork

Replies are listed 'Best First'.
Re^2: How to run the child process parellel to the parent process with fork
by srlbharu (Acolyte) on Mar 15, 2013 at 12:46 UTC

    Sorry for my wrong assumtion. It is proven both processes will be running simultanously. Thanks to all