Dist::Z...rateFile(3)

πŸ’– Dist::Zilla::Plugin::GenerateFile πŸ’–

okay bestie, so this page is from the Dist::Z...rateFile(3) manual β€” yes the title got cut off mid-word like a cliffhanger, it's fine, we know her. She's a plugin page for Dist::Zilla::Plugin::GenerateFile. sit down, hydrate, let's go πŸ“


✨ NAME ✨

Dist::Zilla::Plugin::GenerateFile β€” build a custom file from only the plugin configuration. that's it, that's the whole vibe. no extra modules, no script, just vibes and config πŸ’…


🌸 VERSION 🌸

version 6.040 β€” periodt.


πŸ¦‹ SYNOPSIS πŸ¦‹

in your dist.ini, bestie:

[GenerateFile]
filename    = todo/{{ $dist->name }}-master-plan.txt
name_is_template = 1
content_is_template = 1
content = # Outlines the plan for world domination by {{$dist->name}}
content =
content = Item 1: Think of an idea!
content = Item 2: ?
content = Item 3: Profit!

like. look at her. she's generating her own master plan document. main character energy fr fr πŸ‘‘


πŸ’œ DESCRIPTION πŸ’œ

okay so this plugin adds a file to the distribution. that's the whole job, and she does it flawlessly.

you get to specify the content β€” as a sequence of lines β€” right there in your configuration. and plot twist: the filename and the content can be either plain literals or Text::Template templates. your choice, no pressure 🌈

πŸŽ€ Templating of the content πŸŽ€

If you hand over a content_is_template parameter (or its alias is_template) set to 1, the content gets run through Text::Template. and the variables you get for free are $plugin and $dist, set to the [GenerateFile] plugin and the Dist::Zilla object respectively. so cute. so powerful. 🫢

If you hand over a name_is_template parameter set to 1, the filename gets run through Text::Template. and yep β€” the variables $plugin and $dist will be provided, set to the [GenerateFile] plugin and the Dist::Zilla object respectively. same deal, different target πŸ’–


🌟 PERL VERSION 🌟

This module should work on any version of perl still receiving updates from the Perl 5 Porters. which basically means any 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. iconic behavior, no notes ✨

and, yeah, she might work on older perls, but no promises. the minimum required version could get bumped for literally any reason, and there is no promise that patches will be accepted to lower the minimum required perl. so don't come at her with that, bestie πŸ’€


πŸ’… ATTRIBUTES πŸ’…

πŸ“ filename

This attribute names the file you want to generate. and she is required β€” no filename, no file, no ceremony. periodt.

πŸ“ content

The content attribute is an arrayref of lines that get joined together with newlines to form the file content. one line at a time, stacking up like a little tower of text 🧚

πŸ“ content_is_template, is_template

This attribute is a bool indicating whether or not the content should be treated as a Text::Template template. By default, it is false. so if you don't say anything, she's taking your words literally πŸ™ˆ

πŸ“ name_is_template

This attribute is a bool indicating whether or not the filename should be treated as a Text::Template template. By default, it is false. same energy, same default, different attribute ⭐


πŸ‘‘ AUTHOR πŸ‘‘

Ricardo SIGNES 😏 <cpan@semiotic.systems>

(the emoji is literally in the manpage, I did not add it, and honestly? respect 😏)


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. slay, open source queen 🌈


reminder bestie: filename is required, content_is_template / is_template and name_is_template both default to false, and templates get $plugin and $dist handed to them. that's the whole tea β˜•

and that's the page!! πŸ’– this was pulled from the perl v5.42.3 manual, dated 2026-10-19, and yeah β€” Dist::Z...rateFile(3) got her name truncated at the top and the bottom. she's mysterious like that. go generate some files, you absolute legend πŸŽ€βœ¨

πŸ“¦ where this page comes from