> I appreciated the help. But the perl code in the elsif statement > still doesn't execute until the perl code in the if statement. > Any other suggestions? I'd like the two perl codes to execute at > the same time. > Maybe fork can't do this..
I think you may be misunderstanding what fork() does. When fork() is called, then *entire* program is replicated (aside from copy-on-write issues). The original copy receives from fork() the PID of the new process; the child receives a 0. Aside from this difference, there is *no* difference in the original and the copy. Thus, my $pid; if ($pid=fork()) { # I'm the parent # ... code } elsif (0 == $pid) { # I'm the child # ... code } else { # there was an error # ... code } will follow an execution path determined by which copy is running, but all will flow through simultaneously. It's like multithreading, but with spawned, duplicated processes. Both branches of the code will be executed at the same time, just in seperate copies of the program. That help? __________________________________________________ Do you Yahoo!? Yahoo! Web Hosting - Let the expert host your site http://webhosting.yahoo.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]