Namespace::Dispatch - A dispatcher treating namespaces as a tree
# lib/Foo.pm package Foo; use Namespace::Dispatch; 1; # lib/Foo/Bar.pm package Foo::Bar; use Namespace::Dispatch; 1; # lib/Foo/Bar/Baz.pm package Foo::Bar::Baz; use Namespace::Dispatch; 1; # lib/Foo/Bar/Baz/Next.pm package Foo::Bar::Baz::Next; use Namespace::Dispatch; 1; # any.pl package main; use Foo; Foo->dispatch(qw(bar baz)); #=> Foo::Bar::Baz Foo->dispatch(qw(bar baz next)); #=> Foo::Bar::Baz::Next Foo::Bar->dispatch(qw(bar baz next)); #=> Foo::Bar::Baz::Next Foo->dispatch(qw(hello world)); #=> Foo
Namespace::Dispatch is designed for the purpose that tasks are broke into a set of relevant, hierarchical modules. Implicit dispatching ability was attached into these modules when they are declared as members of this set. Any node in this hierarchy can serve the dispatching requests in recursive manner. That is, Any tree-like routing system can adopt the abstraction under the hood with its own invoking mechanism.
shelling <navyblueshellingford@gmail.com>
App::LDAP
The MIT License
To install Namespace::Dispatch, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Namespace::Dispatch
CPAN shell
perl -MCPAN -e shell install Namespace::Dispatch
For more information on module installation, please visit the detailed CPAN module installation guide.