Dist::Z...teModule(3)

πŸ’– NAME πŸ’–

Dist::Zilla::Plugin::TemplateModule β€” it's a simple module-from-template plugin, bestie. That's the whole vibe. The manual page lives in section 3 (perl v5.42.3, dated 2026-10-19, if you were wondering 🫢).


✨ VERSION ✨

version 6.040 β€” that's the one, no cap.


🌸 DESCRIPTION 🌸

Okay so listen. This is a ModuleMaker β€” it's the thing that makes brand-new Perl module files when you mint a fresh dist with dzil new. It renders a template into a Perl module using Text::Template (by way of Dist::Zilla::Role::TextTemplate, iconic collab tbh).

The template gets two variables handed to it while it's rendering:

  • $name β€” the module name
  • $dist β€” the Dist::Zilla object

And the module it makes is always created as a file under ./lib. That part is non-negotiable, periodt.

By default, the template looks something like this:

use strict;
use warnings;
package {{ $name }};

1;

She's simple, she's clean, she ate πŸ’…


🧚 PERL VERSION 🧚

This module should work on any version of perl that's still receiving updates from the Perl 5 Porters. Which basically means: any version of perl released in the last two to three years. (So like β€” if the most recently released version is v5.40, then this module should work on both v5.40 and v5.38. Easy math πŸ’–)

Fair warning bestie: even though it may work on older versions of perl, there is no guarantee that the minimum required version won't be increased. The version may be increased for any reason, and there is no promise that patches will be accepted to lower the minimum required perl. So don't come for her about it 😭

πŸŽ€ ATTRIBUTES πŸŽ€

template

The "template" parameter can be given to the plugin to give it a different filename β€” absolute, or relative to the build/profile directory. Whatever suits your little heart 🌈

If this parameter isn't specified, the module just uses the boilerplate module template that's included in this module. Built-in slay.


πŸ‘‘ MINTING CONFIGURATION πŸ‘‘

This module is part of the standard configuration of the default Dist::Zilla Minting Profile β€” and of all profiles that don't set a custom ':DefaultModuleMaker' β€” so you don't normally need to do anything to configure it. She's already set up for you, you're welcome 🫢

dzil new Some::Module
# creates ./Some-Module/*
# creates ./Some-Module/lib/Some/Module.pm

However! For those who wish to configure this (or any subclasses), this is presently required:

[TemplateModule / :DefaultModuleMaker]
; template  = SomeFile.pm

(Yes, that semicolon means the template line is commented out. It's giving "optional, but here's how" 😌)


πŸ’œ AUTHOR πŸ’œ

Ricardo SIGNES 😏 <cpan@semiotic.systems>


This software is copyright (c) 2026 by Ricardo SIGNES.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.


And that's the whole page, bestie! 🌟 This lil doc shipped as Dist::Zilla::Plugin::TemplateModule in section 3 of the perl manual, built against perl v5.42.3, stamped 2026-10-19 β€” go forth and mint some modules, you main character πŸ¦‹πŸ’–βœ¨

Dist::Z...teModule(3) β€” okay bye, ily, read the docs πŸ“šπŸ’…

πŸ“¦ where this page comes from