Re: Invoking method by name found in variable

2017-05-23 Thread Elizabeth Mattijsen
> On 23 May 2017, at 20:23, Salve J Nilsen wrote: > > Patrick R. Michaud said: >> On Tue, May 23, 2017 at 09:01:54PM +0300, Gabor Szabo wrote: >>> >>> given an object $o and the name of a method in $method = "run" >>> how can I invoke the $o.run() ? >>> >>> Something like $o.call($method) >>

Re: Invoking method by name found in variable

2017-05-23 Thread Salve J Nilsen
Patrick R. Michaud said: On Tue, May 23, 2017 at 09:01:54PM +0300, Gabor Szabo wrote: given an object $o and the name of a method in $method = "run" how can I invoke the $o.run() ? Something like $o.call($method) At one point it was done as $o."$method"() . my $method = 'say'; 123."$meth

Re: Invoking method by name found in variable

2017-05-23 Thread Timo Paulssen
> Funny, first I tried $o.$method() but that did not work. That is syntax for > when you have a method object or other kind of routine stored in your $method variable

Re: Invoking method by name found in variable

2017-05-23 Thread Gabor Szabo
On Tue, May 23, 2017 at 9:09 PM, Elizabeth Mattijsen wrote: > >> On 23 May 2017, at 20:01, Gabor Szabo wrote: >> given an object $o and the name of a method in $method = "run" >> how can I invoke the $o.run() ? >> >> Something like $o.call($method) > > $o.”$method"() > > $ 6 'my $method = "Str";

Re: Invoking method by name found in variable

2017-05-23 Thread Patrick R. Michaud
On Tue, May 23, 2017 at 09:01:54PM +0300, Gabor Szabo wrote: > given an object $o and the name of a method in $method = "run" > how can I invoke the $o.run() ? > > Something like $o.call($method) At one point it was done as $o."$method"() . > my $method = 'say'; 123."$method"(); 123 Pm

Re: Invoking method by name found in variable

2017-05-23 Thread Elizabeth Mattijsen
> On 23 May 2017, at 20:01, Gabor Szabo wrote: > given an object $o and the name of a method in $method = "run" > how can I invoke the $o.run() ? > > Something like $o.call($method) $o.”$method"() $ 6 'my $method = "Str"; dd 42."$method"()' “42" Liz

Invoking method by name found in variable

2017-05-23 Thread Gabor Szabo
Hi, given an object $o and the name of a method in $method = "run" how can I invoke the $o.run() ? Something like $o.call($method) Gabor