package parent; use strict; sub new { return bless {}, shift; } sub talk { shift; print @_; } 1; package child; use Carp; use strict; use vars qw($AUTOLOAD); sub new { my $self = bless {}, shift; $self->{hndl} = new parent(@_); return $self; } sub AUTOLOAD { $AUTOLOAD =~ s/.*://; if (UNIVERSAL::can("parent", $AUTOLOAD)) { eval " sub $AUTOLOAD { (shift)->{hndl}->$AUTOLOAD(\@_); }"; no strict 'refs'; goto &$AUTOLOAD; } else { confess("Method $AUTOLOAD not implemented"); } } 1; package main; my $thing = new child; $thing->talk("Hello world\n"); # In the interface $thing->bye(); # Oops.