while (kill 0, $parentpid or exit 0) { # ... }