Text::...Handler(3pm)
π Text::...Handler β the ApacheHandler era π
okay bestie, so this page is all about Text::MicroMason::ApacheHandler (3pm), and the whole vibe is: use MicroMason from mod_perl. that's the whole name, that's the whole point. it's giving "templates but make them run inside Apache." β¨
πΈ SYNOPSIS πΈ
first up, you go into your httpd.conf or whatever equivalent Apache configuration file you're living in, and you do this:
PerlModule Text::MicroMason::ApacheHandler
<Files *.mm>
SetHandler perl-script
PerlHandler Text::MicroMason::ApacheHandler
</Files>
then over in your document root, or literally any other web-accessible directory, you drop something like:
<% my $visitor = $r->connection->remote_host(); %>
<html>
Hello there <%= $visitor %>!
The time is now <%= localtime() %>.
</html>
and that's it. that's the whole flex. π
the <% ... %> bits are Perl doing its thing, the <%= ... %> bits are Perl doing its thing out loud, and $r is right there waiting for you like the main character it is. π
π¦ DESCRIPTION π¦
β οΈ Caution, bestie, listen up: This module is new, experimental, and incomplete. Not intended for production use. Interface subject to change. π¨
fr fr. do not be putting this in prod and then acting surprised, i'm begging. π if you're interested in this capability though, your feedback would be appreciated β genuinely, they want to hear from you. π«Ά
π Configuration π
here are the configuration parameters that are supported, one by one, no skips:
MicroMasonSyntaxβ the name of the syntax class that will compile the templates. defaults toHTMLMason. set it like:
PerlSetVar MicroMasonSyntax HTMLMason
MicroMasonMixinsβ the list of additional mixin classes to be enabled. stack 'em up:
PerlAddVar MicroMasonMixins Safe
PerlAddVar MicroMasonMixins CatchErrors
MicroMasonAttribsβ allows for any set of attributes to be defined. mixin names prefaced with a dash can also be included. like so:
PerlAddVar MicroMasonAttribs "-AllowGlobals, allow_globals => '$r'"
so yeah, syntax class, mixins, attribs. that's the whole config trio. iconic. π
π SEE ALSO π
- For an overview of this templating framework, go read
Text::MicroMason. π - This is a mixin class intended for use with
Text::MicroMason::Base. π§ - For distribution, installation, support, copyright and license information, head over to
Text::MicroMason::Docs::ReadMe. π
and that's a wrap, bestie. this page shipped as part of perl v5.36.0, dated 2023-08-10, under the User Contributed Perl Documentation umbrella. slay, goodbye, drink some water. πβ¨π
π¦ 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