X-Git-Url: http://gb7djk.dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FDXUser.pm;h=fa9e109f56cbe5a1cb3ca8cf7b66307290f1a535;hb=e39b738850b9a122b60b179e9723e546ddacfd62;hp=ff45336f30b6732d765004e1de513c3f6b8ff76f;hpb=b374b13c8eb9a57294e4ef0e2f45163341953f85;p=spider.git diff --git a/perl/DXUser.pm b/perl/DXUser.pm index ff45336f..fa9e109f 100644 --- a/perl/DXUser.pm +++ b/perl/DXUser.pm @@ -77,6 +77,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; } @@ -209,9 +212,10 @@ sub put confess "Trying to put nothing!" unless $self && ref $self; my $call = $self->{call}; # delete all instances of this - for ($dbm->get_dup($call)) { - $dbm->del_dup($call, $_); - } +# for ($dbm->get_dup($call)) { +# $dbm->del_dup($call, $_); +# } + $dbm->del($call); delete $self->{annok} if $self->{annok}; delete $self->{dxok} if $self->{dxok}; $dbm->put($call, $self->encode); @@ -255,9 +259,10 @@ sub del my $self = shift; my $call = $self->{call}; # delete all instances of this - for ($dbm->get_dup($call)) { - $dbm->del_dup($call, $_); - } +# for ($dbm->get_dup($call)) { +# $dbm->del_dup($call, $_); +# } + $dbm->del($call); } #