Perl and PHP do this with backticks. For example,
$output = `ls`;
Returns a directory listing. A similar function, system(\"foo\")
system(\"foo\")
Yet another way (or 2!) in Perl....
open my $pipe, 'ps |'; my @output = < $pipe >; say @output;
open can also be written like so...
open my $pipe, '-|', 'ps'