my $pid = open my $pipe, '-|', ... ... if (kill 0 => $pid) { # actions if process alive } else { # actions if process not alive }