Text::...eCache(3pm)
β¨ Text::MicroMason::CompileCache β the manual page, bestie edition β¨
okay so this is Text::MicroMason::CompileCache, a lil mixin that hands your template compilation over to a cache so you're not re-parsing the same thing over and over like a clown. It lives in the User Contributed Perl Documentation, and honestly? It's giving efficiency. π
πΈ NAME πΈ
Text::MicroMason::CompileCache β Use a Cache for Template Compilation. Yes that's the whole name. Short, sweet, iconic. π
π SYNOPSIS π
Bestie, listen: don't use this class directly. Instead you pass its name in to be mixed in:
use Text::MicroMason;
my $mason = Text::MicroMason->new( -CompileCache );
Then you use the standard compile and execute methods to parse and evaluate templates:
print $mason->execute( text=>$template, 'name'=>'Dave' );
And the second time around? The template does not have to be parsed again because it's cached. Obsessed. β¨
print $mason->execute( text=>$template, 'name'=>'Bob' );
Templates stored in files get cached too, and they stay cached until the file changes:
print $mason->execute( file=>"./greeting.msn", 'name'=>'Charles');
π DESCRIPTION π
π« Public Methods π«
compile()β this is just a caching wrapper around the normalcompile()behavior. Same energy, but with memory. π§
π¦ Supported Attributes π¦
compile_cache_textβ defaults to an instance ofText::MicroMason::Cache::Simple. You may pass in your own cache object if you're feeling main character. πcompile_cache_fileβ defaults to an instance ofText::MicroMason::Cache::File. You may pass in your own cache object here too. No cap.
This module uses a simple cache interface that is widely supported: the only methods required are get($key) and set($key, $value). That's it. Two methods. Bare minimum slay. β¨
You can use the simple cache classes provided in the Text::MicroMason::Cache:: namespace, or you can go shopping on CPAN and pick other caching modules that support the interface described in Cache::Cache. Do your thing, bestie. ποΈ
π₯ SEE ALSO π₯
- 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, periodt. π This was perl v5.36.0, dated 2023-08-10, and it ate, no crumbs. πβ¨π¦
π¦ 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