Templa...y::Tmpl(3pm)
β¨ NAME β¨
Template::Alloy::Tmpl β it's the Text::Tmpl role, bestie π (from the Template::Alloy family, Perl's user-contributed docs, 3pm energy)
π DESCRIPTION π
Okay so Template::Alloy::Tmpl is a role that hands you the syntax and the interface for Text::Tmpl. Not just that though β it also pulls in a whole bunch of features from the various other templating systems out there. It's giving β¨multiverse of template enginesβ¨.
For configuration and all the other parameters, go read the Template::Alloy documentation, mkay? π«Ά
π ROLE_METHODS π
parse_tree_tmplβ this one gets called byparse_treewhen the syntax is set to tmpl. It parses for tags,Text::Tmplstyle. Periodt. π₯set_delimitersβ sets theSTART_TAGandEND_TAGthat parsing is gonna use. Slay:
$obj->set_delimiters('#[', ']#');
strerrorβ use this to check the error when a compile fails (or honestly you can just use->error, whatever vibes π). Can be called as a function or as a method β and heads up,Text::Tmplonly allows it as a function. iykyk.set_stripβ decides whether trailing whitespace on the same line gets removed. Default is false. No cap.set_dirβ sets the path where included templates get looked for. π¦set_valueβ sets a single value that's used while the template is being processed. One value, one moment, main character energy:
$obj->set_value(key => $value);
set_valuesβ sets multiple values for use during processing. Bring the whole group chat:
$obj->set_values(\%values);
parse_stringβ processes the string you pass in. Literally just hand it a string and watch it go πΈ:
my $out = $obj->process_string("#[echo $foo]#");
parse_fileβ processes the filename you pass in. Same deal but it's a file bestie:
my $out = $obj->process_file("my/file.tmpl");
loop_iterationβ same as theText::Tmplmethod β it's for adding iterations to a loop. Loops are lowkey iconic:
my $ref = $obj->loop_iteration('loop1'); # creates iteration 0
$ref->set_values($hash);
fetch_loop_iterationβ grabs a loop iteration that was created earlier, like finding the message you forgot to reply to π:
my $ref = $obj->fetch_loop_iteration('loop1', 0);
$ref->set_values($hash);
π UNSUPPORTED Text::Tmpl METHODS π
Not these. They're not supported, so don't come for me. π
register_simple, register_pair, alias_simple, alias_pair, remove_simple, remove_pair, set_debug, errno
π AUTHOR π
Paul Seamons <paul@seamons.com> β the author, the moment, the icon β¨
π LICENSE π
This module may be distributed under the same terms as Perl itself. Fr fr.
That's the whole page, bestie β no notes, you ate. π
This was perl v5.38.2, dated 2024-03-07, and it's the Templa...y::Tmpl(3pm) page, so now you're fully caught up. Mwah ππ
π¦ where this page comes from
- debian trixie: libtemplate-alloy-perl 1.022-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libtemplate-alloy-perl 1.022-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libtemplate-alloy-perl 1.022-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms