#!/usr/bin/perl # Note. HEAD requests are not really supported by the CGI system here. # Or so it seems, anyway. # Initialise System use CGI; my $query = new CGI; ############################################################ # Initialize Parameters my $Iterations = $query->param('Iterations') || 999999; my $Class = $query->param('Class'); $Class =~ s/[^-a-zA-Z0-9]/-/go; if ($Class eq "") { $Class = "-none-"; } ############################################################ # Print HTTP Header print "Content-Type: text/css\r\n"; print "Cache-Control: no-cache\r\n\r\n"; ############################################################ # Print Copyright Information # 1.0 print "\r /* This is an infinite stylesheet.\r ** It is created by infinite.pl, which was\r ** written by Ian Hickson with help from Liam Quinn\r ** and David Baron.\r ** \r ** (c) copyright 1999 by Ian Hickson\r ** http://software.hixie.ch/utilities/cgi/test-tools/\r ** \r ** Class: \"$Class\"\r ** Iterations: \"$Iterations\"\r */\r "; ############################################################ # Print initial classes print "\r .good-$Class-top { background: white none; color: green; font-weight: bold; }\r .bad-$Class-top { background: red none; color: yellow; }\r [good-$Class-top] { background: white none; color: green; font-weight: bold; }\r [bad-$Class-top] { background: red none; color: yellow; }\r "; ############################################################ my $start = time; # Drip Feed Comments while ($Iterations-- > 1) { sleep 1; last if time() - $start > 600; print "\r .good-$Class-$Iterations { background: white none; color: green; font-weight: bold; }\r .bad-$Class-$Iterations { background: red none; color: yellow; }\r [good-$Class-$Iterations] { background: white none; color: green; font-weight: bold; }\r [bad-$Class-$Iterations] { background: red none; color: yellow; }\r \r /* Drip feeding stylesheet... $Iterations iterations to go...\r Random Compressible Junk: \r "; $JUNK = 1024*6; while ($JUNK-- > 1) { print "#"; } print "\r End of Junk */\r "; } ############################################################ # Print final classes print "\r .good-$Class-bottom { background: white none; color: green; font-weight: bold; }\r .bad-$Class-bottom { background: red none; color: yellow; }\r [good-$Class-bottom] { background: white none; color: green; font-weight: bold; }\r [bad-$Class-bottom] { background: red none; color: yellow; }\r "; ############################################################ # Print footer print "\r /* End */\r "; ############################################################