Note this removes the OO'ness of it, i.e. no inheritance.my %dispatch = ('a'=>\&first, 'b'=>\&second); sub dispatch { my $self = shift; my $command = shift; $dispatch{$command}->($self, @_); }
Possibly another option is to prod Damian into finishing Class::Delegation :-)
In reply to Re: Dispatching Method Objects
by runrig
in thread Dispatching Method Objects
by ehdonhon
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |