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

What you do wrong? You don't have $| on, so the output is buffered.

Also, your code executes very shortly. Too short to reliably state which comes first.

Let the run for a while longer. Use else to have the child and parent run side by side.

$| = 1; use Time::HiRes qw(sleep); # allows sleep in fractions of seconds if(fork){ foreach my $i (1 .. 10) { print "I am the parent\n"; sleep 1; } print "parent exiting now.\n"; } else { foreach my $i (1 .. 30) { print "I am the child\n"; sleep 0.3; } print "Bye.\n"; }