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 "$data/qsl.v1";
40 unlink "$local_data/qsl.v1";
42 QSL::init(1) or die "cannot open QSL file";
44 my $base = localdata("spots");
46 opendir YEAR, $base or die "$base $!";
47 foreach my $year (sort readdir YEAR) {
48 next if $year =~ /^\./;
50 my $baseyear = "$base/$year";
51 opendir DAY, $baseyear or die "$baseyear $!";
52 foreach my $day (sort readdir DAY) {
53 next unless $day =~ /(\d+)\.dat$/;
56 my $fn = "$baseyear/$day";
57 my $f = new IO::File $fn or die "$fn ($!)";
62 my ($freq, $call, $t, $comment, $by, @rest) = split /\^/;
63 my $q = QSL::get($call) || new QSL $call;
64 $q->update($comment, $t, $by);