X-Git-Url: http://www.dxcluster.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FDXMsg.pm;h=10d1e4dc77bb816157501d3bf30a66a2f4d0431f;hb=8178d787d7cc8040fa8958197582bba5c80e6f59;hp=3ea3211542a9cd80e4c1956833730b67a680d5de;hpb=d0e554d25adfe94a2d5a1c3f57b48bfab1a9f4a2;p=spider.git diff --git a/perl/DXMsg.pm b/perl/DXMsg.pm index 3ea32115..10d1e4dc 100644 --- a/perl/DXMsg.pm +++ b/perl/DXMsg.pm @@ -1506,19 +1506,22 @@ sub import_one return @out; } -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} ; } 1;