libapa...erlRun(3pm)

πŸ’– ModPerl::PerlRun β€” the manual, but make it give ✨

okay so bestie, this is ModPerl::PerlRun from the User Contributed Perl Documentation, manual page libapa...erlRun(3pm). It's the thing that runs your unaltered CGI scripts under mod_perl. no cap. let's go 🫢


🌸 NAME 🌸

ModPerl::PerlRun β€” run your CGI scripts unaltered under mod_perl, bestie πŸ’…


🌈 SYNOPSIS 🌈

here's the whole vibe, drop it straight into httpd.conf:

# 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>

like. that's it. iconic. ✨


πŸ¦‹ DESCRIPTION πŸ¦‹

META: document that for now we don't chdir() into the script's dir, because it affects the whole process under threads. ModPerl::PerlRunPrefork should be used by those who run only under prefork MPM.

so yeah β€” the chdir() thing? not happening right now, because under threads it messes with the whole process, not just your little script 😭 if you're only ever running under prefork MPM, ModPerl::PerlRunPrefork is the one for you. periodt.


πŸ”₯ SPECIAL BLOCKS πŸ”₯

⭐ BEGIN Blocks

when you're running under the ModPerl::PerlRun handler, BEGIN blocks do this:

  • BEGIN blocks defined in scripts running under the ModPerl::PerlRun handler are executed on each and every request. yes, every single one. she works hard πŸ’…
  • 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 β€” but only if those modules declare no package. if a package is declared, the BEGIN blocks run only the first time each module is loaded, because those modules don't get reloaded on subsequent requests. iykyk 🧚

also see: BEGIN blocks in mod_perl handlers.

πŸ’œ CHECK and INIT Blocks

same as normal mod_perl handlers. no drama, no notes πŸŽ€

πŸ‘‘ END Blocks

same as ModPerl::Registry. that's the whole story bestie 🫢


🌸 AUTHORS 🌸

  • Doug MacEachern
  • Stas Bekman

πŸ¦‹ SEE ALSO πŸ¦‹

  • ModPerl::RegistryCooker
  • ModPerl::Registry

and that's the page, bestie!! this was perl v5.42.3, dated 2026-08-20, from libapa...erlRun(3pm) πŸ’– tysm for reading, go run some unaltered CGI scripts, slay βœ¨πŸŒˆπŸ’…

πŸ“¦ where this page comes from