#! /usr/bin/perl
print "Content-Type: text/html\n\n";
$year=$ENV{QUERY_STRING};
exit unless($year=~/^\d\d\d\d$/);
print <
Seminar Information ($year)
Seminar Information ($year)
EOF
populate("/home/sem/data.to2008");
populate("/home/sem/data");
for(keys %entry){
if($_=~/^$year/){
push @k,$_;
}
}
@k=sort {$a<=>$b} @k;
@y=sort {$a<=>$b} (keys %ys);
for(@y){
print <$_
EOF
}
for(@k){
emit($_);
}
print <
EOF
sub emit{
my $i=shift;
my ($date,$place,$speaker,$subject)=@{$entry{$i}};
@a=;
if(scalar @a!=0){
my $file=$a[0];
$subject=qq($subject);
}
print <
$date; $place
EOF
}
sub populate{
my $f=shift;
open(IN,$f);
undef $/;
my $all=;
close(IN);
my @x=split "\n\n", $all;
for(@x){
my ($tag,$date,$place,$speaker,$subject)=
split "\n";
if(exists $entry{$tag}){
$tag+=0.1;
}
# next if(exists $entry{$tag});
$tag=~/^(\d\d\d\d)/;
$ys{$1}=1;
$entry{$tag}=[$date,$place,$speaker,$subject];
}
}