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

nph-count.cgi (415B) - 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 
      9 print "OK, starting time consuming process ... \n";
     10 
     11 # Tell Perl not to buffer our output
     12 $| = 1;
     13 
     14 for ( my $loop = 1; $loop <= 30; $loop++ ) {
     15     print "Iteration: $loop\n";
     16     ## Perform some time consuming task here ##
     17     sleep 1;
     18 }
     19 
     20 print "All Done!\n";