use Carp 'croak'; sub pass_thru { my($self, $method, @args) = @_; my $func = $self->can($method); croak "No such function '$method' in ".(ref $self || $self) unless $func; return $func->(@args); }