#!/usr/local/bin/perl
use strict;
use CGI qw/:standard/;
$| = 1; #I was hoping that this would make it that stuff
#stuff was sent to the browser each time rather than
#waiting till the end of the script
################### MAIN ##########
my $cgi = CGI->new();
print $cgi->header() . "\n";
html_1();
some_long_process();
html_2();
############################################
sub html_1 {
print "\n";
print "your stuff is being processed
\n";
}
sub html_2{
print "\n";
print "your process is done
\n";
}