How to capture STDOut of script in a CGI script?

Hi Perl Experts,
I am invoking a shell script thru a perl script and the perl script is cgi script.I need to capture the STDOUT of the shell script in the html page where I am invoking the script .?The shell script takes couple of mintutes to complete its execution .Mean while my html page does not show any thing.I want to display the STDOUT of the shell script in the html page.

Thanks:b:

if you are executing the external script by backticks then just capture the output into a variable, and print that variable.
system() does not return the external programs output, just it's exit code
exec() does the same as system, and never returns
use backticks.