Config:...Template(3)
π¦ Config::Generator::Template(3) β the Perl manpage, but make it a group chat
Okay bestie, so this is a page from the User Contributed Perl Documentation for Config::Generator::Template, and honestly? It's giving "quiet little module that does a lot of heavy lifting." Come sit with me π
β¨ NAME β¨
Config::Generator::Template β literally just Config::Generator template support. That's the whole name. Short, sweet, iconic. π
πΈ DESCRIPTION πΈ
So this module eases configuration file generation by hooking you up with template support. No cap.
A template is, like, a file with markup in it. You feed it a high-level configuration, and the template gets processed and transformed into a low-level configuration file. That's the whole vibe β high-level in, low-level out, slay. β¨
π SYNTAX π
This is the part you're gonna screenshot, bestie. The template commands are enclosed within <{ and }>. And if PATH represents a path in the high-level configuration:
<{PATH}>β gets replaced by the value of PATH. Simple. Gorgeous. π<{open()}>β gets replaced by<{(yes, the opener itself, meta much?)<{close()}>β gets replaced by}><{if(PATH)}>xxx<{endif(PATH)}>β becomesxxxif PATH is true, or""otherwise. And like, this is done using Perl's conditional testing, iykyk.<{ifnot(PATH)}>xxx<{endif(PATH)}>β same asif()but negated. Flip it and reverse it π¦<{if_true(PATH)}>xxx<{endif(PATH)}>β same asif()but tested usingConfig::Validator'sis_true()<{if_false(PATH)}>xxx<{endif(PATH)}>β same asif()but tested usingConfig::Validator'sis_false()<{ifdef(PATH)}>xxx<{endif(PATH)}>β becomesxxxif PATH is defined (i.e. set), or""otherwise<{ifndef(PATH)}>xxx<{endif(PATH)}>β same asifdef()but negated. Again with the flipping π₯
Heads up bestie:if_true()andif_false()lean onConfig::Validator, not plain Perl truthiness. Different vibe check, different results. Don't mix them up π
π FUNCTIONS π
This module provides the following functions β and listen, none of them are exported by default, so you gotta ask nicely:
declare_template(NAME...)β declare one or more template names so they can be customized using the/Templateschema πexpand_template(NAME[, HASH])β read and process the named template, using the given hash as well as the high-level configurationprocess_template(TEMPLATE, HASH...)β process the given template string using the given hashesread_template(NAME)β return the contents of the named template, unprocessed. Raw. Untouched. Just how it came into this world π
π AUTHOR π
Lionel Cons <http://cern.ch/lionel.cons> β absolute main character energy fr fr.
Copyright (C) CERN 2013-2016 β so yeah, CERN owns this one, and that's genuinely iconic of them β
And that's the whole page, bestie!! π«Ά Per the footer: this was perl v5.32.1, dated 2019-07-26, and it's Config:...Template(3) all day long. Now go generate some configs, you gorgeous little templating machine πβ¨π
π¦ where this page comes from
- epel 9: perl-Config-Generator 1.0-10.el9 Β· GPL+ or Artistic
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms