package UnloadedObject; use Class::MethodMaker ( new_hash_init => 'new', get_set => [qw( Table Class ID )] ) sub AUTOLOAD { my $method = $AUTOLOAD; $method =~ s/.*:://; my $table = $self->Table; my $id = $self->ID; my $class = $self->Class; my $self = $_[0]; my $sub = $class->can($method) || $class->can("AUTOLOAD"); die "Can't call $method on $class" unless defined($sub); bless $self, $class; %$self = (); $table->fillFromID($self, $id); goto &$sub; }