This is a good article on this subject. This is the more simple solution using the instsrv and srvany applications to register and run a script as a named service(you can control them with the net command). Dave Roth explains this in better detail in his excellent book:Win32 Perl Scripting. In the same chapter (Chapter 8: Win32 Services) he dives into his module Win32::Daemon which appears to be a more powerful and robust way to write services. | [reply] [d/l] [select] |
Incidentally, using cron or the Windows equivalent "Scheduled Tasks" is usually a better way to go than a script that runs forever. | [reply] |
| [reply] |
Ack! a forever loop???. Did you look into converting the script to a service? Take a look at perlapp from active state, it will take your script and make it an executable. There are others that do this but I can't think of their names at the moment. Not had my coffee yet! ;)
But as to your question. Since Perl is interpreted you see the Perl Binary listed as it is running your script.
Edit:Now that I have had my coffee. Perrin is correct. A scheduled task is a better approach as it will not put the cycles on the cpu as a forever loop does.
| [reply] |
I agree with the other comments in this thread regarding running a permanent loop. However, I assume there is a chance you don't have the time right now to change your setup. A very simple way (and a complete hack) of telling which of your scripts are running would be to *copy* the perl executable (c:\perl\bin\perl.exe) to another filename (c:\perl\bin\foo.exe), and then exec it using foo.exe. Then, when you check processes you'll see one script running as foo.exe and another running as perl. This is rather untidy, but simple to do in less than a minute. | [reply] |