You don't need to extract the PID because you already have it. That's how you got the output, after all. If you wanted to do it this way (and it's not the way you should do it), you want to look if you get output besides the header line.
--
brian d foy <bdfoy@cpan.org>
| [reply] |
Yes, your kill 0, $pid is indeed a much better solution.
The only reason to extract the PID with my solution is to check it against the PID that you have stored, which as you say isn't that great when we can just ask the system directly.
It still would have worked tho :)
| [reply] [d/l] |