Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Using $variable in place of "Method" in Module::Submodule::Method( @args )

by broquaint (Abbot)
on Aug 24, 2006 at 14:53 UTC ( #569379=note: print w/replies, xml ) Need Help??


in reply to Using $variable in place of "Method" in Module::Submodule::Method( @args )

Seems like a good place to use can e.g
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); }
HTH

_________
broquaint

  • Comment on Re: Using $variable in place of "Method" in Module::Submodule::Method( @args )
  • Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://569379]
help
Chatterbox?
[Discipulus]: i'd like to be the vote fairy just one month.. ;=)
[choroba]: My average XP per node lowered in the last three months :(
[choroba]: (check my homenode for the graph link and the tool to create it)

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (10)
As of 2017-04-26 11:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (474 votes). Check out past polls.