Shlomi Fish <[email protected]> writes:
[...]
> sub dispatch
> {
> my ($method, @rest_of_args) = @_;
Not sure what $method is supposed to be doing.
> my %dispatch =
> (
> 'N' => sub { return N_func(@rest_of_args); },
> 'L' => sub { return L_func(@rest_of_args); },
> .
> .
> .
> );
>
> return $dispatch{$method}->();
> }
Where is $method being sent?
What I'm trying to do:
Iterating through a list of lists using a dispatch table to
`dispatch' one member of each list fed to it, or sometimes the whole
list needs to be acted on.
I'm trying to work up a good example but having to experiment a lot to
get even that done.
--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/