Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
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?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (15)
As of 2015-07-31 15:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (279 votes), past polls