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); }
_________
broquaint
In reply to Re: Using $variable in place of "Method" in Module::Submodule::Method( @args )
by broquaint
in thread Using $variable in place of "Method" in Module::Submodule::Method( @args )
by aplonis
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |