in reply to Re^2: method dispatch question
in thread method dispatch question
Can this still be written in one line, without intermediate variable $mref?
$self->get_mref->($self, @args);
or make get_mref return a code reference that captured $self so you can omit it when calling it.
sub get_mref { my ($self) = @_; my $coderef = \&some_method; return sub { $self->$coderef(@_) }; } $self->get_mref->(@args);
|
|---|