docs::a...:PerlRun(3)

πŸ“¦ version 2.0.13, in nixos 26.05, nixpkgs unstable

πŸ’– NAME πŸ’–

ModPerl::PerlRun β€” run unaltered CGI scripts under mod_perl. This is the docs::a...:PerlRun(3) page from the User Contributed Perl Documentation, bestie. πŸ’…

✨ Synopsis ✨

Here’s the httpd.conf setup, exactly as written:

# httpd.conf
PerlModule ModPerl::PerlRun
Alias /perl-run/ /home/httpd/perl/
<Location /perl-run>
    SetHandler perl-script
    PerlResponseHandler ModPerl::PerlRun
    PerlOptions +ParseHeaders
    Options +ExecCGI
</Location>

🌸 Description 🌸

Real talk: the page has a literal META note β€” META: document that for now we don’t chdir() into the script’s dir, because it affects the whole process under threads. So yeah, that’s the situation. 🫠

Also important: ModPerl::PerlRunPrefork should be used by those who run only under prefork MPM. Periodt. πŸ‘‘

πŸ¦‹ Special Blocks πŸ¦‹

πŸŽ€ BEGIN Blocks πŸŽ€

When running under the ModPerl::PerlRun handler, BEGIN blocks behave as follows:

  • BEGIN blocks defined in scripts running under the ModPerl::PerlRun handler are executed on each and every request.
  • BEGIN blocks defined in modules loaded from scripts running under ModPerl::PerlRun (and which weren’t already loaded prior to the request) are executed on each and every request only if those modules declare no package. If a package is declared BEGIN blocks will be run only the first time each module is loaded, since those modules don’t get reloaded on subsequent requests.

See also BEGIN blocks in mod_perl handlers. iykyk πŸ’«

🧚 CHECK and INIT Blocks 🧚

Same as normal mod_perl handlers. No cap.

⭐ END Blocks ⭐

Same as ModPerl::Registry. Slay.

πŸ‘‘ Authors πŸ‘‘

  • Doug MacEachern
  • Stas Bekman

🌈 See Also 🌈

ModPerl::RegistryCooker and ModPerl::Registry.


mwah πŸ’‹ β€” this page is from the User Contributed Perl Documentation, perl v5.42.3, dated 2023-10-21, and the manpage tag is docs::a...:PerlRun(3). iconic. πŸ’–βœ¨

πŸ“¦ where this page comes from