add the beginnings of an ARRL log query and updater
[spider.git] / perl / DXUtil.pm
index 9f411812d6b2207d02d34b2de7581af78fe4314f..db52ad81076fa91d67a165b60adc8e567c58d8d9 100644 (file)
@@ -16,10 +16,8 @@ use Data::Dumper;
 use strict;
 
 use vars qw($VERSION $BRANCH);
-$VERSION = sprintf( "%d.%03d", q$Revision$ =~ /(\d+)\.(\d+)/ );
-$BRANCH = sprintf( "%d.%03d", q$Revision$ =~ /\d+\.\d+\.(\d+)\.(\d+)/  || (0,0));
-$main::build += $VERSION;
-$main::branch += $BRANCH;
+
+main::mkver($VERSION = q$Revision$) if main->can('mkver');
 
 use vars qw(@month %patmap @ISA @EXPORT);
 
@@ -30,6 +28,7 @@ require Exporter;
                         filecopy ptimelist
              print_all_fields cltounix unpad is_callsign is_latlong
                         is_qra is_freq is_digits is_pctext is_pcflag insertitem deleteitem
+                        is_prefix
             );
 
 
@@ -363,6 +362,11 @@ sub is_callsign
                                         $!x;
 }
 
+sub is_prefix
+{
+       return $_[0] =~ m!^(?:[A-Z]{1,2}\d+ | \d[A-Z]{1,2}\d+)!x        # basic prefix
+}
+
 # check that a PC protocol field is valid text
 sub is_pctext
 {