X-Git-Url: http://www.dxcluster.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FDXChannel.pm;h=7a27a8f2bc3bd3a90eda6efaaf388e9c6bc312fc;hb=4e5b3de7a26563d94678fb790b8a1e2c4daaac8d;hp=b7d32c44ad4f22e6a98693f7e531d373b61835fb;hpb=1910df7183401a62084e85c3ace179df492a6fbe;p=spider.git diff --git a/perl/DXChannel.pm b/perl/DXChannel.pm index b7d32c44..7a27a8f2 100644 --- a/perl/DXChannel.pm +++ b/perl/DXChannel.pm @@ -466,8 +466,13 @@ sub AUTOLOAD $name =~ s/.*:://o; confess "Non-existant field '$AUTOLOAD'" if !$valid{$name}; - @_ ? $self->{$name} = shift : $self->{$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}} ; + @_ ? $self->{$name} = shift : $self->{$name} ; } + 1; __END__;