in reply to Dispatching Method Objects
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 :-)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re (tilly) 2: Dispatching Method Objects
by tilly (Archbishop) on Oct 03, 2001 at 21:26 UTC |