my $pid = 1234; if( kill 0, $pid ) { # it's alive } else { # it's dead }