cgi-dev

Repository that serves as my CGI "scratchpad" to try things out.
git clone git://git.samirparikh.com/cgi-dev
Log | Files | Refs | README

count.cgi (475B) - raw


      1 #!/usr/bin/perl -wT
      2 
      3 use strict;
      4 
      5 #print "$ENV{SERVER_PROTOCOL} 200 OK\n";
      6 #print "Server: $ENV{SERVER_SOFTWARE}\n";
      7 #print "Content-type: text/plain\n\n";
      8 print "Content-type: text/plain;charset=iso-8859-1\n\n";
      9 
     10 print "OK, starting time consuming process ... \n";
     11 
     12 # Tell Perl not to buffer our output
     13 $| = 1;
     14 
     15 for ( my $loop = 1; $loop <= 10; $loop++ ) {
     16     print "Iteration: $loop\n";
     17     ## Perform some time consuming task here ##
     18     sleep 1;
     19 }
     20 
     21 print "All Done!\n";