#!/usr/bin/perl # * put your path to perl5 above * # ======================================================================== # *March Madness NCAA Final Four Pool Script* test.cgi # # Modify the perl path above and the paths to the log files below. Then # call this script from your browser and it will tell you whether or # not everything is set up OK. # # This particular script just tests to make sure everything is set up # correctly. It tries open and write to the log files to make sure # you have your permissions set up correctly. Then it tries to grab # a file off the infohiway server to make sure that the code works with # your server configuration and version of Perl. # # See http://www.infohiway.com/javascript/indexf.htm?perlhelp for help. # # script courtesy of http://www.infohiway.com/javascript # ======================================================================== MAIN: { $path0 = "teams.log"; # path of teams.log file $path1 = "entries.log"; # path of entries.log file $path2 = "started.log"; # path of started.log file $path3 = ""; # directory containing results0.log through results6.log $| = 1; #no buffering of output print STDOUT "Content-type: text/html\n\n"; for $num (0 .. 2) { $path = ${path.$num}; open(RESULTS,"$path") || print STDOUT "Error opening $path. You need to run this unix command on it: \"chmod 666 $path\"
\n"; close(RESULTS); open(RESULTS,">>$path") || print STDOUT "Error writing to $path. You need to run this unix command on it: \"chmod 666 $path\"
\n"; print RESULTS ""; close(RESULTS); } #test results0.log through results6.log for $num (0 .. 6) { $path = $path3."results$num.log"; open(RESULTS,"$path") || print STDOUT "Error reading $path. You need to run this unix command on it: \"chmod 666 $path\"
\n"; close(RESULTS); open(RESULTS,">>$path") || print STDOUT "Error writing to $path. You need to run this unix command on it: \"chmod 666 $path\"
\n"; print RESULTS ""; close(RESULTS); } print STDOUT "
Done with test. If no errors were listed above, everything appears to be set up OK.

For more help, see the Infohiway Perl installation help page."; exit; }
Make your own free website on Tripod.com