ovedpo15 has asked for the wisdom of the Perl Monks concerning the following question:
Hey guys.
Consider a function (lets call it A) which returns 1 if a process finished running, otherwise 0.
I would like to write another function which should wait until the process will finish running.
What's the best why to do it?
I thought of using the while loop and the wait(30); command.
Something like this:
What's the best way to do so?
I'm looking for the cleanest way to do it.
Consider a function (lets call it A) which returns 1 if a process finished running, otherwise 0.
I would like to write another function which should wait until the process will finish running.
What's the best why to do it?
I thought of using the while loop and the wait(30); command.
Something like this:
I also can just call this subroutine until it will finish, although I don't think its smart because of all unnecessary junk.until(A()) { sleep(30); }
What's the best way to do so?
I'm looking for the cleanest way to do it.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: waiting for process to finish
by Corion (Patriarch) on Jul 16, 2018 at 07:06 UTC | |
by ovedpo15 (Pilgrim) on Jul 16, 2018 at 12:26 UTC | |
by Corion (Patriarch) on Jul 16, 2018 at 12:29 UTC | |
|
Back to
Seekers of Perl Wisdom