in reply to dynamic method creation, dispatch table or pseudo methods?
you could do something like (untested)
Of course this will be slower than your suggestions...sub my_meth { my $self = shift; my $cmd = $self->{api_meth}; unless ( defined $cmd ) { # default } else { eval { $cmd->(@_) } or raise_error(); } }
TIMTOWTDI and YMMV :)
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
|
|---|