3 # Implement a 'GO' database list
5 # Copyright (c) 2003 Dirk Koopman G1TLH
10 # search local then perl directories
14 # root of directory tree for this system
16 $root = $ENV{'DXSPIDER_ROOT'} if $ENV{'DXSPIDER_ROOT'};
18 unshift @INC, "$root/perl"; # this IS the right way round!
19 unshift @INC, "$root/local";
30 use vars qw($end $lastyear $lastday $lasttime);
33 $SIG{TERM} = $SIG{INT} = sub { $end++ };
37 $main::systime = time;
39 unlink "$root/data/qsl.v1";
41 QSL::init(1) or die "cannot open QSL file";
43 my $base = "$root/data/spots";
45 opendir YEAR, $base or die "$base $!";
46 foreach my $year (sort readdir YEAR) {
47 next if $year =~ /^\./;
49 my $baseyear = "$base/$year";
50 opendir DAY, $baseyear or die "$baseyear $!";
51 foreach my $day (sort readdir DAY) {
52 next unless $day =~ /(\d+)\.dat$/;
55 my $fn = "$baseyear/$day";
56 my $f = new IO::File $fn or die "$fn ($!)";
61 my ($freq, $call, $t, $comment, $by, @rest) = split /\^/;
62 my $q = QSL::get($call) || new QSL $call;
63 $q->update($comment, $t, $by);