X-Git-Url: http://dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FDXUser.pm;h=afc70cb0e08516f0331b19264782528950e8d823;hb=8178d787d7cc8040fa8958197582bba5c80e6f59;hp=6b85afb3025c4883d247a46b3735f8220cf98d58;hpb=d0e554d25adfe94a2d5a1c3f57b48bfab1a9f4a2;p=spider.git diff --git a/perl/DXUser.pm b/perl/DXUser.pm index 6b85afb3..afc70cb0 100644 --- a/perl/DXUser.pm +++ b/perl/DXUser.pm @@ -86,26 +86,29 @@ $lrusize = 2000; build => '1,Build', ); -no strict; +#no strict; sub AUTOLOAD { my $self = shift; + no strict; my $name = $AUTOLOAD; return if $name =~ /::DESTROY$/; - $name =~ s/.*:://o; + $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; - } - return $self->{$name}; + *$AUTOLOAD = sub {@_ > 1 ? $_[0]->{$name} = $_[1] : $_[0]->{$name}}; + &$AUTOLOAD($self, @_); +# *{$AUTOLOAD} = sub {@_ > 1 ? $_[0]->{$name} = $_[1] : $_[0]->{$name}} ; +# if (@_) { +# $self->{$name} = shift; +# } +# return $self->{$name}; } -use strict; +#use strict; # # initialise the system