#!/usr/bin/perl
#print "Content-type: text/html\n\r\n\r";
unshift(@INC,"/usr/local/lib/perl5");
require "ctime.pl";
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
my $newday = sprintf("%2d%02d%02d", $year, $mon+1, $mday);
srand();
my @days = split(/\n/,`ls -1 */*/*/index.htmlf`);
my $rdays = @days;
#print "rdays = $rdays\n";
my $rday = (rand time) % $rdays;
#print "rday = $rday\n";
my $day = @days[$rday];
#print "day = $day\n";
chop($day);
print "Location: /today/$day\n\r\n\r";