added HC and QRZ to QSL.pm
authorminima <minima>
Wed, 12 Mar 2003 13:30:46 +0000 (13:30 +0000)
committerminima <minima>
Wed, 12 Mar 2003 13:30:46 +0000 (13:30 +0000)
Changes
perl/LRU.pm
perl/QSL.pm

diff --git a/Changes b/Changes
index 349df747ad30fca5a2b9435b0d2a3c0718d20d8f..28a42c5b02483e53c966c85f70eaebb44a6cd46a 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,3 +1,7 @@
+12Mar03=======================================================================
+1. added HC and QRZ.com to possible QSL locations, if you want to pick up
+historical info (ie start again), run create_qsl.pl after update and restart
+the node (which you will need to do anyway).
 11Mar03=======================================================================
 1. Changed the name of show/qsl to show/dxqsl.
 2. Alter Commands_en.hlp to match new name and issue manual updates (g0vgs)
index 30b264a525c1ec4afb17d4705d91f8e90ca136de..29fd3c87e46b048525938ab385c73f6d4f4b48b8 100644 (file)
@@ -11,7 +11,7 @@
 #
 # The structure of the base is:-
 #
-#  [next, prev, max objects, count ]
+#  [next, prev, max objects, count, <coderef to function to call on deletion> ]
 #
 #
 
@@ -37,8 +37,9 @@ sub newbase
        my $pkg = shift;
        my $name = shift;
        my $max = shift;
+       my $coderef = shift;
        confess "LRU->newbase requires a name and maximal count" unless $name && $max;
-       return $pkg->SUPER::new({ }, $max, 0, $name);
+       return $pkg->SUPER::new({ }, $max, 0, $name, $coderef);
 }
 
 sub get
@@ -86,6 +87,7 @@ sub remove
        my $q = $self->obj->{$call};
        confess("$call is already removed") unless $q;
        dbg("LRU $self->[5] cache remove $call now $self->[4]/$self->[3]") if isdbg('lru');
+       &{$self->[5]}($q->obj) if $self->[5];
        $q->obj(1);
        $q->SUPER::del;
        delete $self->obj->{$call};
index abb8b86cf6a771e850f1532195b3fef246144146..0de926888d48ae195c33bce72b1f1e3e4b20932f 100644 (file)
@@ -38,7 +38,7 @@ sub init
                dbg("load Storable from CPAN");
                return undef;
        }
-       import Storable qw(nfreeze thaw);
+       import Storable qw(nfreeze freeze thaw);
        my %u;
        if ($mode) {
                $dbm = tie (%u, 'DB_File', $ufn, O_CREAT|O_RDWR, 0666, $DB_BTREE) or confess "can't open qsl file: $qslfn ($!)";
@@ -68,9 +68,15 @@ sub update
        my $t = shift;
        my $by = shift;
                
-       my @tok = map {/^BUR/ || is_callsign($_) ? $_ : ()} split(/\b/, uc $line);
+       my @tok = map {/^(?:HC|BUR|QRZ|HOME)/ || is_callsign($_) ? $_ : ()} split(/\b/, uc $line);
        foreach my $man (@tok) {
-               $man = 'BUREAU' if $man =~ /^BUR/;
+               if ($man =~ /^BUR/) {
+                       $man = 'BUREAU';
+               } elsif ($man eq 'HC' || $man =~ /^HOM/) {
+                       $man = 'HOME CALL';
+               } elsif ($man =~ /^QRZ/) {
+                       $man = 'QRZ.com';
+               }
                my ($r) = grep {$_->[0] eq $man} @{$self->[1]};
                if ($r) {
                        $r->[1]++;