Use the following:
$self->$ref();
Using this syntax, $ref can be a reference to a subroutine or even to a line with the name of the method to call, for example,
my $ref = "foo"; $self->$ref();
Keep in mind that they have slightly different semantics regarding inheritance.
If you do not pass explicit arguments, brackets are optional:
$self->$ref;
Otherwise use
$self->$ref($arg1, \%arg2, @others);
Greg bacon
source share