--- name: wait status: documented runtime: pp source: src/runtime/pp/process.rs --- ```{index} single: wait; Perl built-in (pp runtime) ``` # wait ## Synopsis ```perl my $pid = wait(); print "Child $pid exited with status $?\n"; ``` ## Description Waits for any child process to terminate. Suspends the current process until any child process terminates. Returns the PID of the deceased child, or `-1` if there are no child processes. Sets `$?` to the wait status of the child (encoding exit code and signal information). ## See also waitpid, fork, `$?`