> I am on NT 4.0 with ActivePerl 5.6 Build 633. > > Is it possible to write a "service" (Aka Daemon in unix) for NT M/C > using perl? If so, are there any modules which I can use? > This script should be continously running waiting for some commands. > Once it gets the specified command, it should > fork another process and do the required job.
It's generaly safer to use system() or something similar under windows that fork()ing and continuing with the script. The thing is that fork() creates a new THREAD, not a new process. And some modules may not like it. I have had success with fork()ing and THREADs anyway though, but I had to be a little carefull and I always "prefork()ed" the worked threads. That is instead of fork()ing every time I needed something done, I kept one or more worker threads and piped them commands. The most important trick was to load modules I only need in either worker or normal threads AFTER the fork()ing. For the "service" related stuff I used Win32::Daemon. Jenda =========== [EMAIL PROTECTED] == http://Jenda.Krynicky.cz ========== There is a reason for living. There must be. I've seen it somewhere. It's just that in the mess on my table ... and in my brain I can't find it. --- me _______________________________________________ ActivePerl mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
