dhosek has asked for the wisdom of the Perl Monks concerning the following question:

I've got some code which uses something along the lines of
$dispatcher{$code}->($self, $parameter)
where each element of the %dispatcher hash is an anonymous subroutine which handles dealing with the various possibilities for $code.

The problem comes in where I'm realizing that what I'm frequently writing entries that look like:

foo => sub {$self = shift; $self->set_foo(shift); },
Obviously, I should be able to replace the anonymous subroutine with a straight reference to set_foo. The catch comes in that I can't seem to find the right formulation of the reference. In this case, set_foo is generated on a field in the parent class using Object::InsideOut. Any ideas on what the correct syntax should be at referencing the setter?