Perl implements hashes such that lookups are extremely efficient. The size of the hash doesn't matter.
Your syntax,
$self->{message_types}->{$type}->(@args);
should be fine. What's the error? What's your code? Remember, that won't use the current value of $self, but the one $self had when the anonymous sub was created (assuming $self was a lexical (my) variable).
In reply to Re^3: Dispatch table within package question
by ikegami
in thread Dispatch table within package question
by hubb0r
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |