--- name: qx status: documented runtime: pp source: src/runtime/pp/io.rs --- ```{index} single: qx; Perl built-in (pp runtime) ``` # qx ## Synopsis ```perl my $output = `command`; my $output = qx{command}; my @lines = `command`; ``` ## Description Executes a shell command and captures its standard output. Passes the command string to `/bin/sh -c "..."` for execution. In scalar context, returns the entire captured stdout as a single string. In list context, returns a list of lines (each including its trailing newline), split on `$/` (input record separator). After execution, `$?` (child error) is set to the child process wait status. Stdin is inherited from the parent so that interactive commands (e.g. `tput`) work correctly; stderr is also inherited. ## See also system, exec, open