嗨此脚本需要3 * 2秒的时间,然后立即在浏览器中打印输出,帮助重新
#!C:/perl/bin/perl.exe
use warnings;
use strict;
use CGI;
my $cgi = new CGI;
print $cgi->header();
print $cgi->start_html("First");
print $cgi->h1("First");
sleep(2);
print $cgi->h1("Second");
sleep(2);
print $cgi->h1("Third");
print $cgi->end_html();
答案 0 :(得分:1)
您可以设置$| = 1;
以刷新每个打印输出缓冲区,但在返回任何内容之前它看起来像Apache will wait for the script to finish running,因此您可能需要将睡眠逻辑移动到客户端JavaScript。