in reply to Running script from script
Fellow Monk,
I'm not sure in this context why you are using package in this case at all. Package is normally used when you are creating a module. Given this example of what I'm talking about:
and in another file:package myFoo; sub new { return {},"myFoo"; } sub stuff { } 1;
use myFoo; my $f = new myFoo(); $f->stuff;
Of course the example I give is a total NOOP but that's besides the point.
You formed electrons and spake thusly:
That's a rather open ended statement. Without understanding the underlying mechanics of your system invocation with respect to the behavior of the program you are executing with it in my opinion all I can do is give you a speculative answer.
In my own experience if I am spawning a child process and I want to know if the process is still running I may use one of the following schemes:
Some research you could do is look at Nagios plugin sources and see how they determine if a process is up or not.
Another observation is that since you are using system are you really kicking off multiple instances of the code you are trying to execute? I've never personally executed Wine from within a Perl script but I'd think that until it finishes execution it is going to block further execution of your script. A way around that is to use fork() and execute your system command within the child process. That way you can check to see if the child PID is still active and if you capture SIGCHLD you can be notified in the parent process when the child dies.
Hope this helps...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Running script from script
by Ransom (Beadle) on Jul 11, 2012 at 15:21 UTC | |
by blue_cowdawg (Monsignor) on Jul 11, 2012 at 15:29 UTC |