Mike_Ca has asked for the wisdom of the Perl Monks concerning the following question:
Is there a way to print and display the results from run.pl to browser as the results gradually are being generated without having to output the whole result to a temporary file then displaying the file in the end? Thanks#!/usr/bin/perl -w use CGI qw(:standard); $| = 1; if (my $pid = fork) { print header,start_html("start"); print ('<META HTTP-EQUIV="Refresh" CONTENT="5; URL=/results/file1. +html">'); print h1('Starting...'); print ('If it does not start up, click <A HREF="/results/file1.htm +l">here</ A>'); print end_html(); } else { close STDIN; close STDOUT; system ('echo \'<META HTTP-EQUIV="Refresh" CONTENT="10; URL=/resul +ts/file.html">\' > /www/html/results/file.html'); exec '/www/cgi-bin/run.pl > /www/html/results/file.html &'; die "couldnt exec - $!\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to output result from perl script to page gradually instead of in 1 shot?
by pboin (Deacon) on Oct 06, 2005 at 17:47 UTC | |
|
Re: How to output result from perl script to page gradually instead of in 1 shot?
by Perl Mouse (Chaplain) on Oct 06, 2005 at 16:24 UTC |