Peter Rabbitson wrote:
I think I am getting the idea of fork() all wrong. Here is an example:
my $pid = fork();
if ($pid) { # should apply to parent only?
exit;
}
sleep 1;
print "Test\n";
exit;
'Test' does not print. If I remove the 'sleep 1' - it prints. From what
I understood fork creates two identical processes that become completely
independent from each other. What am I missing?
Peter
It should print Test, but you should wait for a while .. [ ~ 1 sec ]
Test is printed by the child process.
--
Binish A R