X-Git-Url: http://gb7djk.dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FPrefix.pm;h=954490fcf41e2798ad39ba6c6951b89002922dd5;hb=2b58ccdf81685a1167a43c38705a0d84b9d8d661;hp=b71f754e640ee0b18bf441db8ccfc31b2ad9debd;hpb=e4df86158dd5138a1fea25dd693b67fd9d78fb56;p=spider.git diff --git a/perl/Prefix.pm b/perl/Prefix.pm index b71f754e..954490fc 100644 --- a/perl/Prefix.pm +++ b/perl/Prefix.pm @@ -9,13 +9,19 @@ package Prefix; use IO::File; -use Carp; use DXVars; use DB_File; use Data::Dumper; -use Carp; +use DXDebug; 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; +$main::build += $VERSION; +$main::branch += $BRANCH; + use vars qw($db %prefix_loc %pre); $db = undef; # the DB_File handle @@ -153,9 +159,9 @@ sub extract $p = $parts[0]; shift @parts if $p =~ /^(WEB|NET)$/o; $p = $parts[$#parts]; - pop @parts if $p =~ /^(\d+|[PABM]|AM|MM|BCN|SIX|WEB|NET|Q\w+)$/o; + pop @parts if $p =~ /^(\d+|[JPABM]|AM|MM|BCN|JOTA|SIX|WEB|NET|Q\w+)$/o; $p = $parts[$#parts]; - pop @parts if $p =~ /^(\d+|[PABM]|AM|MM|BCN|SIX|WEB|NET|Q\w+)$/o; + pop @parts if $p =~ /^(\d+|[JPABM]|AM|MM|BCN|JOTA|SIX|WEB|NET|Q\w+)$/o; # can we resolve them by direct lookup foreach $p (@parts) { @@ -189,6 +195,7 @@ my %valid = ( itu => '0,ITU', cq => '0,CQ', utcoff => '0,UTC offset', + cont => '0,Continent', ); no strict; @@ -201,6 +208,9 @@ sub AUTOLOAD $name =~ s/.*:://o; confess "Non-existant field '$AUTOLOAD'" if !$valid{$name}; + # this clever line of code creates a subroutine which takes over from autoload + # from OO Perl - Conway + *{$AUTOLOAD} = sub {@_ > 1 ? $_[0]->{$name} = $_[1] : $_[0]->{$name}} ; if (@_) { $self->{$name} = shift; }