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 to do it in Perl (TIMTOWTDI)
$output = <<`END`; ls END
This is specially useful when embedding a relatively large shell script in a Perl program