Like this, you mean?
package Foo; sub new { bless {}, shift }; sub method { shift; return shift() + shift() } package main; my $foo = Foo->new; my $method = "method"; my @args = ( 2, 3 ); print $foo->$method( @args );
Or am I missing something?
In reply to Re: Calling a method by name without eval()
by FunkyMonk
in thread Calling a method by name without eval()
by atemerev
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |