X-Git-Url: http://www.dxcluster.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FDXChannel.pm;h=372599af1a3806dec7c1c37e540345ce58804e45;hb=8178d787d7cc8040fa8958197582bba5c80e6f59;hp=e6e0d1b42634e365022c66650788ce979c36e862;hpb=d0e554d25adfe94a2d5a1c3f57b48bfab1a9f4a2;p=spider.git diff --git a/perl/DXChannel.pm b/perl/DXChannel.pm index e6e0d1b4..372599af 100644 --- a/perl/DXChannel.pm +++ b/perl/DXChannel.pm @@ -622,20 +622,23 @@ sub broadcast_list } -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}} ; - @_ ? $self->{$name} = shift : $self->{$name} ; + *$AUTOLOAD = sub {@_ > 1 ? $_[0]->{$name} = $_[1] : $_[0]->{$name}}; + &$AUTOLOAD($self, @_); +# *{$AUTOLOAD} = sub {@_ > 1 ? $_[0]->{$name} = $_[1] : $_[0]->{$name}} ; +# @_ ? $self->{$name} = shift : $self->{$name} ; }