In a distribution, I have to duplicate the same pieces of information again and again. For example, bug report email and web URLs should be written in [MetaResources] section of dist.ini and in the documentation, like BUGS.pod.
[MetaResources]
With a help from Templates plugin I can eliminate duplication. If BUGS.pod is a template, I can use email and web URLs defined in dist.ini, e. g.:
Templates
{{$dist->distmeta->{resources}->{bugtracker}->{mailto};}}
Err… This works but requires a lot of typing (so it is typo-prone), and looks ugly. With Hook I can make it not only working, but also elegant. [Hook::Init] section defines few variables in MY package, which can be used in various templates, including documentation and meta resources.
Hook
[Hook::Init]
MY
To install Dist::Zilla::Plugin::Hook, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Dist::Zilla::Plugin::Hook
CPAN shell
perl -MCPAN -e shell install Dist::Zilla::Plugin::Hook
For more information on module installation, please visit the detailed CPAN module installation guide.