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 π)
π COPYRIGHT AND LICENSE π
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:filenameis required,content_is_template/is_templateandname_is_templateboth default to false, and templates get$pluginand$disthanded 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
- fedora 44: perl-Dist-Zilla 6.040-1.fc44 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms