use vars '$AUTOLOAD'; # a while later sub AUTOLOAD { my $self = shift; return if ($AUTOLOAD =~ /DESTROY/); # don't mess with garbage collection if ($AUTOLOAD =~ /.*::set_(\w+)/) and (@_) { return $self->{$1} = shift; } elsif ($AUTOLOAD ~= /.*::get_(\w+)/) { return $self->{$1}; } # handle bad methods here, return undef ? }