Text::...emplate(3pm)
π NAME π
Text::MicroMason::QuickTemplate β alternate syntax, lowkey iconic, literally just like Text::QuickTemplate. π¦
This is a page from the perl manual, bestie β Text::...emplate(3pm), if you're keeping track. π
β¨ SYNOPSIS β¨
okay so first thing: do not use this class directly, no cap. You pass its name in so it gets mixed in:
use Text::MicroMason;
my $mason = Text::MicroMason::Base->new( -QuickTemplate );
Then you use the standard compile and execute methods to parse and evaluate your templates, slay:
print $mason->compile( text=>$template )->( @%args );
print $mason->execute( text=>$template, @args );
Or, if you'd rather roll with Text::QuickTemplate's calling conventions (main character energy tbh):
$template = Text::MicroMason->new( -HTMLTemplate, text=>'simple.tmpl' );
print $template->fill( %arguments );
Text::QuickTemplate hands you a syntax to embed values into a text template, and it's giving:
Good {{timeofday}}, {{name}}!
πΈ DESCRIPTION πΈ
So this is a mixin class, and what it does is override several methods so that MicroMason can emulate the template syntax of Text::QuickTemplate plus some of its other features too. π
And not me casually dropping that it automatically includes these other mixins, for free, no extra charge:
TemplateDirHasParamsStoreOne
π Compatibility with Text::QuickTemplate π
okay real talk: this is not a drop-in replacement for Text::QuickTemplate, because the implementation is quite different. π But it should be able to process most existing templates without major changes, so likeβ¦ we move. π«Ά
The following features of EmbPerl syntax are supported:
- Curly bracketed tags with parameter names. π
- Array of parameters hashes.
- Special
$DONTSETvariable. (iconic, mysterious, we respect her)
π SEE ALSO π
- The interface being emulated is described in
Text::QuickTemplate. - For an overview of this templating framework, see
Text::MicroMason. - This is a mixin class intended for use with
Text::MicroMason::Base. - For distribution, installation, support, copyright and license information, see
Text::MicroMason::Docs::ReadMe.
and that's the whole page bestie, go forth and template responsibly π
this was perl v5.36.0, dated 2023-08-10 β so like, vintage but still ate. π β¨
π¦ where this page comes from
- debian trixie: libtext-micromason-perl 2.23-5 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libtext-micromason-perl 2.23-5 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libtext-micromason-perl 2.23-5 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libtext-micromason-perl 2.23-5 Β· 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