#
sub AUTOLOAD
{
- my $self = shift;
no strict;
my $name = $AUTOLOAD;
return if $name =~ /::DESTROY$/;
# 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}};
- &$AUTOLOAD($self, @_);
+ *{$AUTOLOAD} = sub {@_ > 1 ? $_[0]->{$name} = $_[1] : $_[0]->{$name}};
+ goto &$AUTOLOAD;
-# @_ ? $self->{$name} = shift : $self->{$name} ;
}
1;