Hi This script is taking 3*2 secs time and then printing the output in the browser at once, help re
#!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();
You can set
$| = 1;
to flush the output buffer with each print, but it looks like Apache will wait for the script to finish running before returning anything, so you might need to move your sleep logic into client side JavaScript.