X-Git-Url: http://dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FDXUser.pm;h=52b7819d4ace901067280cd6396f164281621c7e;hb=b91254375e95e7931312c4177ee390866f82c648;hp=0785d16b2c1b1a6c1945ef41cc67a074b0a5dbbb;hpb=0a26d8269de811ac52450fcb411ebac7cab1d382;p=spider.git diff --git a/perl/DXUser.pm b/perl/DXUser.pm index 0785d16b..52b7819d 100644 --- a/perl/DXUser.pm +++ b/perl/DXUser.pm @@ -63,8 +63,9 @@ $lasttime = 0; pingint => '9,Node Ping interval', nopings => '9,Ping Obs Count', wantlogininfo => '9,Login info req,yesno', - wantgrid => '0,DX Grid Info,yesno', + wantgrid => '0,DX Grid Info,yesno', lastoper => '9,Last for/oper,cldatetime', + nothere => '0,Not Here Text', ); no strict; @@ -77,6 +78,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; } @@ -240,8 +244,8 @@ sub decode my $ref; eval '$ref = ' . $s; if ($@) { - dbg('err', $@) if $@; - Log('err', $@) if $@; + dbg($@); + Log('err', $@); $ref = undef; } return $ref; @@ -337,7 +341,7 @@ BEGIN { # try to detect a lockfile (this isn't atomic but # should do for now - $lockfn = "$root/perl/cluster.lock"; # lock file name + $lockfn = "$root/perl/cluster.lck"; # lock file name if (-e $lockfn) { open(CLLOCK, "$lockfn") or die "Can't open Lockfile ($lockfn) $!"; my $pid = ;