Maypole...ication(3)
π Maypole::Application β Universal Maypole Frontend π
okay bestie, you found the manual page for Maypole::Application (it's Maypole...ication(3), yes the title got chopped, we love a dramatic ellipsis). It's a User Contributed Perl Documentation page and it's literally the universal frontend situation. Let's get into it π«Ά
β¨ NAME β¨
Maypole::Application β Universal Maypole Frontend. she does it all, no cap π
πΈ SYNOPSIS πΈ
use Maypole::Application;
use Maypole::Application qw(Config::YAML);
use Maypole::Application qw(-Debug Config::YAML -Setup);
use Maypole::Application qw(Config::YAML Loader -Setup -Debug);
use Maypole::Application qw(-Debug2 MasonX AutoUntaint);
look at all those little incantations. pick your fighter π
π¦ DESCRIPTION π¦
This is a universal frontend for mod_perl1, mod_perl2, HTML::Mason and CGI. one entry point, so many environments, it's giving versatility β¨
It automatically figures out the appropriate frontend for your environment β unless you wanna use MasonX::Maypole, in which case you gotta include "MasonX" in the arguments. (yes, manually. she can't read your mind for that one π)
It loads plugins supplied in the use statement. π¦
It responds to flags supplied in the use statement. π©
It initializes the application's configuration object. π§
Here's the cute part: you can omit the Maypole::Plugin:: prefix from plugins. So Maypole::Plugin::Config::YAML becomes Config::YAML. shorter, sweeter, iconic.
use Maypole::Application qw(Config::YAML);
You can also set special flags like -Setup, -Debug and -Init.
use Maypole::Application qw(-Debug Config::YAML -Setup);
β οΈ The position of plugins in the chain is important, because they are loaded/executed in the same order they appear. order matters bestie, don't just shuffle them around π
π FRONTEND π
- Under
mod_perl(1 or 2), it selectsApache::MVC. - Otherwise, it selects
CGI::Maypole. - If
"MasonX"is specified, it setsMasonX::Maypoleas the frontend. This currently also requires amod_perlenvironment.
π FLAGS π
π -Setup
use Maypole::Application qw(-Setup);
is equivalent to
use Maypole::Application;
MyApp->setup;
Note that no options are passed to setup(). You must ensure that the required model config parameters are set in "MyApp->config". See Maypole::Config for more information. do your homework on the config, she's not gonna guess it for you π
π -Init
use Maypole::Application qw(-Setup -Init);
is equivalent to
use Maypole::Application;
MyApp->setup;
MyApp->init;
Note that the "-Setup" flag is required for the "-Init" flag to work. no setup, no init, that's the rule fr fr
In persistent environments (e.g. "mod_perl"), it is useful to call "init" once in the parent server, rather than at the beginning of the first request to each child server, in order to share the view code loaded during "init". way more efficient, main character energy π
β οΈ Note that you must supply all the config data to your app before calling"setup"and"init", probably by using one of the"Maypole::Plugin::Config::*"plugins. config first, always π
π -Debug
use Maypole::Application qw(-Debug);
is equivalent to
use Maypole::Application;
sub debug { 1 }
You can specify a higher debug level by saying "-Debug2" etc. crank it up as high as you need π₯
π AUTHOR π
Sebastian Riedel, "sri@oook.de". Idea by Marcus Ramberg, "marcus@thefeed.no". shoutout to the originators, absolute legends π«Ά
π LICENSE π
You may distribute this code under the same terms as Perl itself.
and that's the whole page bestie!! π this one's from perl v5.42.0, dated 2025-07-25 β so yeah, that's the version and the date, mwah, go forth and use Maypole::Application responsibly β¨ππ¦
π¦ where this page comes from
- fedora 43: perl-Maypole 1:2.13-46.fc43 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms