laziness, impatience, and hubris | |
PerlMonks |
Using $variable in place of "Method" in Module::Submodule::Method( @args )by aplonis (Pilgrim) |
on Aug 23, 2006 at 19:11 UTC ( [id://569172]=perlquestion: print w/replies, xml ) | Need Help?? |
aplonis has asked for the wisdom of the Perl Monks concerning the following question: I have need of calling any one of umpteen methods, like so...
...where the arg list varies by quantity, etc. The real call is for Device::LabJack with a sample method call like so...
...and where the method might be 'AISample', 'EAnalogIn', 'EAnalogOut', or any of a long list of others. I don't want to write a separate call for each. What I'd very much like is some means of passing that method name in as a variable...the same variable which I now employ to trigger assembly of an appropriate arg list. Some way of doing what would otherwise look like the (incorrect) usage below...
Might there be some methodology whereby I can pass a variable to stand in for the method name? I could then use a single outer method to pass that name to the inner like so...
Thanks,
Back to
Seekers of Perl Wisdom
|
|