sub AUTOLOAD { my ( $self, $arg ) = @_; no strict 'refs'; (my $method = $AUTOLOAD ) =~ s/^.*:://; if ( exists $self->{_data}->{$method} ) { *{$AUTOLOAD} = sub { my ( $self, $arg ) = @_; if ( defined $arg ) { $self->{_data}->{$method} = $arg; } return $self->{_data}->{$method}; }; } else { croak qq%Can't locate object method $method via package % . __PACKAGE__ ; } goto &{$AUTOLOAD}; }