&{ # call the result of the block as a sub $self->{ # lookup in hash $self the result of $dispatch{$command} # lookup $command in %dispatch } }(); # call the sub with no arguments
I am guessing you want to call the sub, passing $self, which should be
&{$dispatch{$command}}($self);
In reply to Re: Dispatching Method Objects
by gbarr
in thread Dispatching Method Objects
by ehdonhon
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |