X-Git-Url: http://dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FDXHash.pm;h=28dc77d3ba4656ac03f5773db147a9531ea647d1;hb=6ec22e78a4a344ce675645fabf18b2a1971f364a;hp=54faad9bf4d586b0ddb79e63793f6cbe96c978f4;hpb=2b58ccdf81685a1167a43c38705a0d84b9d8d661;p=spider.git diff --git a/perl/DXHash.pm b/perl/DXHash.pm index 54faad9b..28dc77d3 100644 --- a/perl/DXHash.pm +++ b/perl/DXHash.pm @@ -8,13 +8,13 @@ # Things entered into the list are always upper # cased. # -# The files that are created live in /spider/data +# The files that are created live in /spider/local_data (was data) # # Dunno why I didn't do this earlier but heyho.. # # Copyright (c) 2001 Dirk Koopman G1TLH # -# $Id$ +# # package DXHash; @@ -25,26 +25,24 @@ 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; - sub new { my ($pkg, $name) = @_; - my $s = readfilestr($main::data, $name); - my $self = eval $s if $s; + + # move existing file + localdata_mv($name); + my $s = readfilestr($main::local_data, localdata($name)); + my $self = undef; + $self = eval $s if $s; dbg("error in reading $name in DXHash $@") if $@; - $self = bless {name => $name}, $pkg unless $self; + $self = bless({name => $name}, $pkg) unless defined $self; return $self; } sub put { my $self = shift; - writefilestr($main::data, $self->{name}, undef, $self); + writefilestr($main::local_data, $self->{name}, undef, $self); } sub add