Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: How do I examine the status of a process?

by stephen (Priest)
on Feb 05, 2000 at 05:15 UTC ( [id://2890] : note . print w/replies, xml ) Need Help??


in reply to How do I examine the status of a process?

In general, you can use "kill" with signal number zero to check on the existence of a process. See 'man perlipc' for details. Here's code:
use strict; MAIN: { my $pid = $ARGV[0]; if (kill 0 => $pid) { print STDOUT "Process '$pid' exists\n"; } else { print STDOUT "Process '$pid' does not exist\n"; } }