My advice is not to use fork if you want your script to run cross platform. You will have enough problems writing cross-platform, multi-process perl code without dragging fork into it. The safest and simplist way to do what you want is to use open2 or open3 to pipe to and from child processes. Yes, you loose efficiency on unix, but by avoiding fork, your program will be truely multi-process on win32. If you want to lower the overhead on process startup consider not letting child processes die but instead have them signal the parent that they are ready for another task.
Any way you cut it, multi-process with cross-platform is a pain in the ass. Your best bet may be to write cross platform modules with all the general application code and then write two different process managers, one for unix using fork and one for win32 using open2. If the code must be exactly the same for both platforms then code on win32 and port to unix. Unix can be too nice to you and you may take behaviour for granted and be stuck when win32 isn't so nice. - Johnathan ps. no flame war intended, but there are other languages you might want to consider that have robust support for multi-threading. java or python may be a better choice... but with any luck perl6 will let me stop saying that. srinivas krish wrote: >Hi!, > >I have to make a platform independent script that will >start a server and client in the script. I attempted >this using fork method. Although the script runs well >in UNIX, it does not run on Nt - giving the error: >The process cannot access the file because >it is being used by another process. >The Unsupported function fork function is >unimplemented at > line 60. >I have Active Perl 5.6 in my case. Even the document >says that "On some platforms such as Windows where the >fork() system call is not available, Perl can be built >to emulate fork() at the interpreter level. " > >can anyone guide as to how the script can be made to >run in UNIX and DOS(I am using cygwin32 for NT)? > >Regards >srinivas > > >________________________________________________________________________ >Looking for a job? Visit Yahoo! India Careers > Visit http://in.careers.yahoo.com > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]