|
|
| go ahead... be a heretic | |
| PerlMonks |
Running a Perl script in the background from another Perl scriptby mikeo (Initiate) |
| on Jul 10, 2001 at 18:33 UTC ( [id://95408]=perlquestion: print w/replies, xml ) | Need Help?? |
This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.mikeo has asked for the wisdom of the Perl Monks concerning the following question:
Note: I am a Perl newbie with about 10 days of experience in the language. Translation: "I'm dumb. Don't make me cry too much."
I'm presently writing a command line interface for a script. I want to be able to start and stop a second process from the first. I have been unable to figure out a solution that works for my specific situation. Here's what I've tried so far: Option#1: system("start ANYFILE.pl"); This allows me to fire off the second Perl script in the background, but I am unable to figure out a way to maintain some kind of reference to the process through which I can kill it. Option #2: $PID = fork(); This would allow me to keep a handle on the process if I were able to figure out how to use it to fire off the second Perl script. Option #3: This would be a great solution, since it allows me to keep a handle on the process. The problem is I am unable to figure out how to launch a Perl script using it. Apparently, even though I have my extensions correct I cannot "execute" a Perl script. I would appreciate help getting any of these solutions to work, a solution other than these which would solve my problem, and even explainations as to why one or more of these solutions wouldn't work. It's always a plus to learn what you did wrong and why it's wrong! -Mikeo BTW, the script is being developed on a Windows box for use on Windows boxes.
Back to
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||||||||||||