Maypole...ication(3)

πŸ“¦
version 2.13 Β· 2 versions
, in fedora 43

πŸ’– 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 selects Apache::MVC.
  • Otherwise, it selects CGI::Maypole.
  • If "MasonX" is specified, it sets MasonX::Maypole as the frontend. This currently also requires a mod_perl environment.

πŸ‘‘ 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