#!/usr/bin/perl # Generate "realtime" data. # Run as a non-parsed-header CGI script, i.e. # the server should not cache this script's # output. It should pass it straight through # to the browser without waiting for EOF. $| = 1; # unbuffer STDOUT...very important! $SERVER_SOFTWARE = $ENV{'SERVER_SOFTWARE'}; $SERVER_PROTOCOL = $ENV{'SERVER_PROTOCOL'}; print "$SERVER_PROTOCOL 200 OK\n"; print "Server: $SERVER_SOFTWARE\n"; print "Content-type: text/plain\n\n"; print "Countdown:\n\n"; foreach (0..20) { print "\t", 20 - $_, "\n"; sleep 1; } print "boing!\n";