The simplest way without modifying your code is:
Callback::do_callback(sub { $self->do_something() });I might instead add a callback_method() function that takes the name of a method to call and constructs a callback:
sub callback_method { my ($method, $invocant) = splice( @_, 0, 2 ); $invocant->$method( @_ ); }
In reply to Re: Package coderefs
by chromatic
in thread Package coderefs
by moot
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |