X-Git-Url: http://dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FDXChannel.pm;h=7a27a8f2bc3bd3a90eda6efaaf388e9c6bc312fc;hb=26d388e9e65e585c9883ba19fc9b12bdf5aec525;hp=b7d32c44ad4f22e6a98693f7e531d373b61835fb;hpb=e69b2b430d27710d1bb636f9aa7720da1d067359;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__;