Perl and PHP do this with backticks. For example,
$output = `ls`;
Returns a directory listing. A similar function, system(\"foo\")
system(\"foo\")
stream := open("ls", "p") while line := read(stream) do { # stuff }
The docs call this a pipe. One of the good things is that it makes the output look like you're just reading a file. It also means you can write to the app's stdin, if you must.