package Foo; sub new { my ($conn) = @_; return bless { CONN => $conn }; } sub AUTOLOAD { my ($self, @args) = @_; my ($class, $method) = (our $AUTOLOAD) =~ /(.*)::(.*)/s; return $self->{CONN}->$method(@args); } 1;