iaw4 has asked for the wisdom of the Perl Monks concerning the following question:
my $pid = system_bg("cd /tmp ; sleep 50");
# do other stuff
while (still_alive($pid)) {
print STDERR "you are so lucky, your pid is still there\n";
}
print STDERR "ok, your pid has now finished\n";
preferably, this would work on most unix systems. I know that I can fork/exec, but this seems painful. has someone written such a module?
help appreciated.
sincerely,
/iaw
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: background system() and stillalive() sub
by jbt (Chaplain) on Aug 02, 2009 at 03:41 UTC | |
by iaw4 (Monk) on Aug 03, 2009 at 18:39 UTC | |
|
Re: background system() and stillalive() sub
by Marshall (Canon) on Aug 02, 2009 at 06:36 UTC | |
by cdarke (Prior) on Aug 02, 2009 at 12:36 UTC | |
by Marshall (Canon) on Aug 02, 2009 at 13:09 UTC | |
|
Re: background system() and stillalive() sub
by Anonymous Monk on Aug 02, 2009 at 15:25 UTC |