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:

package myFoo; sub new { return {},"myFoo"; } sub stuff { } 1;
and in another file:
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...


Peter L. Berghold -- Unix Professional
Peter -at- Berghold -dot- Net; AOL IM redcowdawg Yahoo IM: blue_cowdawg

In reply to Re: Running script from script by blue_cowdawg
in thread Running script from script by Ransom

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.