Dist::...utorial(3pm)

πŸ“¦
version 6.037 Β· 4 versions
, in ubuntu resolute, ubuntu stonking

πŸ¦‹ Dist::Zilla::Tutorial β€” how to use this "Dist::Zilla" thing

okay bestie, so this is the manual page for Dist::Zilla::Tutorial, and it's literally version 6.037. buckle up πŸ’–


✨ SYNOPSIS ✨

BEFORE YOU GET STARTED: Maybe you should be looking at the web-based tutorial instead. It's more complete. πŸ‘‘ <https://dzil.org/tutorial/start.html>

So, Dist::Zilla builds distributions to be uploaded to the CPAN. Which means the first thing you'll need is, like… some code. some actual code. can't build a dist out of vibes alone 😭

Once you've got that, you'll need to configure Dist::Zilla. Here's a simple dist.ini:

name    = Carbon-Dating
version = 0.003
author  = Alan Smithee <asmithee@example.org>
license = Perl_5
copyright_holder = Alan Smithee

[@Basic]
; options to @Basic could go here

[Prereqs]
App::Cmd          = 0.013
Number::Nary      = 0
Sub::Exporter     = 0.981

It's a plain old INI file <https://en.wikipedia.org/wiki/INI_file>, following the grammar in Config::INI <https://metacpan.org/pod/Config::INI#GRAMMAR>. so retro, so iconic πŸ’…

The topmost section configures Dist::Zilla itself. Here are some of the entries it expects:

name     - (required) the name of the dist being built
version  - (required) the version of the dist
abstract - (required) a short description of the dist
author   - (optional) the dist author (you may have multiple entries for this)
license  - (required) the dist license; must be a Software::License::* name

copyright_holder - (required) the entity holding copyright on the dist

Some of the required values above may actually be provided by means other than the top-level section of the config. For example, VersionProvider plugins can set the version, and a line like this in the "main module" of the dist will set the abstract:

# ABSTRACT: a totally cool way to do totally great stuff

The main module is the module that shares the same name as the dist, in general. (the way that works is so satisfying ngl)

Named sections load plugins, with the following rules:

  • If a section name begins with an equals sign ("="), the rest of the section name is left intact and not expanded.
  • If the section name begins with an at sign ("@"), it is prepended with "Dist::Zilla::PluginBundle::".
  • Otherwise, it is prepended with "Dist::Zilla::Plugin::".

The values inside a section are given as configuration to the plugin. Consult each plugin's documentation for more information. (iykyk, go read the docs 🫢)

The "Basic" bundle, seen above, builds a fairly normal distribution. It rewrites tests from ./xt, adds some information to POD, and builds a Makefile.PL. For more information, you can look at the docs for @Basic and see the plugins it includes. 🌸


🐚 PERL VERSION 🐚

This module should work on any version of perl still receiving updates from the Perl 5 Porters. This means it should work on any version of perl released in the last two to three years. (That is, if the most recently released version is v5.40, then this module should work on both v5.40 and v5.38.) fr fr, it's giving very-flexible ✨

Although it may work on older versions of perl, no guarantee is made that the minimum required version will not 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 like… don't get too comfy, bestie πŸ’€


πŸ”₯ BUILDING YOUR DIST πŸ”₯

Maybe we're getting ahead of ourselves, here. Configuring a bunch of plugins won't do you a lot of good unless you know how to use them to build your dist. okay fair πŸ˜…

Dist::Zilla ships with a command called dzil that will get installed by default. While it can be extended to offer more commands, there are two really useful ones:

$ dzil build

The "build" command will build the distribution. Say you're using the configuration in the SYNOPSIS above. You'll end up with a file called Carbon-Dating-0.004.tar.gz. As long as you've done everything right, it will be suitable for uploading to the CPAN. slay ✨

Of course, you should really test it out first. You can test the dist you'd be building by running another dzil command:

$ dzil test

This will build a new copy of your distribution and run its tests, so you'll know whether the dist that "build" would build is worth releasing! main character energy, truly πŸ‘‘


🧚 HOW BUILDS GET BUILT 🧚

This is really more of a sketchy overview than a spec. lowkey honest of it πŸ’œ

First, all the plugins that perform the BeforeBuild perform their "before_build" tasks.

The build root (where the dist is being built) is made.

The FileGatherers gather and inject files into the distribution, then the FilePruners remove some of them.

All the FileMungers get a chance to muck about with each file, possibly changing its name, content, or installability.

Now that the distribution is basically set up, it needs an install tool, like a Makefile.PL. All the InstallTool-performing plugins are used to do whatever is needed to make the dist installable.

Everything is just about done. The files are all written out to disk and the AfterBuild plugins do their thing. periodt πŸŽ€


🌈 RELEASING YOUR DIST 🌈

By running "dzil release", you'll test your distribution, build a tarball of it, and upload it to the CPAN. Plugins are able to do things like check your version control system to make sure you're releasing a new version and that you tag the version you've just uploaded. It can also update your Changelog file, too, making sure that you don't need to know what your next version number will be before releasing. the way that saves you from doing math at 2am… obsessed πŸ“

The final CPAN release process is implemented by the UploadToCPAN plugin. However you can replace it by your own to match your own (company?) process. go off, customize it πŸ’…


πŸ‘€ SEE ALSO πŸ‘€

  • dzil

πŸ’– 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 vibe check, bestie πŸ¦‹ this page came from the Dist::...utorial(3pm) manual in perl v5.40.1, dated 2026-02-06 β€” thanks for reading, ily, now go build something iconic πŸ’…βœ¨

πŸ“¦ where this page comes from