in reply to Re: Dispatch table within package question
in thread Dispatch table within package question

I prefer:

return $self->$message_types{$type}->(@args);

To me, it looks more like a method call.

Update: Yep, invoking a coderef from a hash is a little too complex for the parser to handle.

Replies are listed 'Best First'.
Re^3: Dispatch table within package question
by bpphillips (Friar) on Jan 27, 2005 at 13:33 UTC
    that's fine, unfortunately, I can't get that to compile... Maybe you were thinking something like:
    my $method = $message_types{$type}; $self->$method(@args);
    Which I agree looks more like a method call and avoids having to pass $self manually -- Brian