package MyModule; use OtherModule; sub new { my $class = shift; my $obj = OtherModule->new( @_ ); return bless \$obj, $class; } sub AUTOLOAD { my $self = shift; my ($method) = (our $AUTOLOAD =~ /([^:]+)$/; return eval { ${$self}->$method( @_ ); } } # These are in UNIVERSAL, so need to be overridden because # AUTOLOAD won't catch them. sub can { my $self = shift; return eval { ${$self}->can( @_ ); } } sub isa { my $self = shift; return eval { ${$self}->isa( @_ ); } } 1; __END__