first cut of localqsl
[spider.git] / perl / create_localqsl.pl
index 2d3fc57e6fa0c7772a78f4bd4019e36f26e3221c..14693d63f21e13c140d8e769cd8e8ea22167bc59 100755 (executable)
@@ -27,6 +27,9 @@ use DXUtil;
 use Spot;
 use DXDb;
 
+my $end = 0;
+$SIG{TERM} = $SIG{INT} = sub { $end++ };
+
 my $qslfn = "localqsl";
 
 $main::systime = time;
@@ -49,9 +52,10 @@ foreach my $year (sort readdir YEAR) {
        my $baseyear = "$base/$year";
        opendir DAY,  $baseyear or die "$baseyear $!";
        foreach my $day (sort readdir DAY) {
-               next if $day =~ /^\./;
+               next unless $day =~ /dat$/;
                my $fn = "$baseyear/$day";
                my $f = new IO::File $fn  or die "$fn ($!)"; 
+               print "doing: $fn\n";
                while (<$f>) {
                        if (/(QSL|VIA)/i) {
                                my ($freq, $call, $t, $comment, $by, @rest) = split /\^/;
@@ -62,6 +66,7 @@ foreach my $year (sort readdir YEAR) {
                                }
                        }
                }
+               $f->close;
        }
 }