[Chicago-talk] Dynamic method call
Steven Lembark
lembark at jeeves.wrkhors.com
Thu Nov 6 10:47:07 CST 2003
-- JT Smith <jt at plainblack.com>
> I do this all the time...and you've got it absolutely right.
Depends on whether you prefer to use indirect references. Using
can() to pre-filter the name gives better control/error messages.
> On Thu, 6 Nov 2003 09:21:16 -0600
> "Jay Strauss" <me at heyjay.com> wrote:
>> How do I call a method, where a variable contains the method name?
>>
>> my $method = "do_something";
>> $self->$method;
--
Steven Lembark 2930 W. Palmer
Workhorse Computing Chicago, IL 60647
+1 888 359 3508
More information about the Chicago-talk
mailing list