#!/usr/bin/perl # this script turns the grades.cvs file into the file to put on the web. print < Script Generated Grades END # bad hack to print a timestamp ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) = localtime(time); if ($mon == 2) { $mon = March; $year = 2006 } print "

Excel was too big of a pain in the ass

\n"; print "

Script run: $mday, $mon $year $hour:$min

\n"; # read in the header line chomp($line = ); # eat the ecst username and name fields for($count = 0; $count < 2; $count++) { $line =~ s/^[^,]*,//; } # now were are ready for the table and headers print "\n"; print ""; foreach $field (split /,/, $line) { print ""; } print ""; # print out the student lines while ($line = ) { chomp($line); # eat the ecst username and name fields for($count = 0; $count < 2; $count++) { $line =~ s/^[^,]*,//; } # now print the students grades print ""; foreach $field (split /,/, $line) { print ""; } print ""; } print "
$field
$field
\n"; print "\n"; print "\n";