projects
/
spider.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fiz strange carp errors on startup with no route_*_cache files
[spider.git]
/
perl
/
DXHash.pm
diff --git
a/perl/DXHash.pm
b/perl/DXHash.pm
index 870ac9cc4dedd17d01bbea823f840121b8bb95c0..cf9f05211c202ff10cd42798f22542822921dd36 100644
(file)
--- a/
perl/DXHash.pm
+++ b/
perl/DXHash.pm
@@
-8,13
+8,13
@@
# Things entered into the list are always upper
# cased.
#
# 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
#
#
# Dunno why I didn't do this earlier but heyho..
#
# Copyright (c) 2001 Dirk Koopman G1TLH
#
-#
$Id$
+#
#
package DXHash;
#
package DXHash;
@@
-28,17
+28,21
@@
use strict;
sub new
{
my ($pkg, $name) = @_;
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, $name);
+ my $self = undef;
+ $self = eval $s if $s;
dbg("error in reading $name in DXHash $@") if $@;
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;
return $self;
}
sub put
{
my $self = shift;
- writefilestr($main::data, $self->{name}, undef, $self);
+ writefilestr($main::
local_
data, $self->{name}, undef, $self);
}
sub add
}
sub add