libapa...:Global(3pm)
π NAME π
ModPerl::Global β bestie, it's the Perl API for manipulating special Perl lists β¨
β¨ SYNOPSIS β¨
okay so here's the whole vibe in code form, no cap:
use ModPerl::Global ();
my $package = 'MyApache2::Package';
# make the END blocks of this package special
ModPerl::Global::special_list_register(END => $package);
# Execute all encoutered END blocks from this package now
ModPerl::Global::special_list_call( END => $package);
# delete the list of END blocks
ModPerl::Global::special_list_clear( END => $package);
πΈ DESCRIPTION πΈ
So ModPerl::Global hands you an API to mess with special perl lists, and rn the only list it's obsessed with is the "END" blocks list. That's it. That's the whole roster. π
The way this works is that it lets you switch up normal Perl behavior and run those special lists whenever you decide it's time, which is honestly so main character of you.
Example time: ModPerl::RegistryCooker uses it to run "END" blocks inside scripts at the end of every single request. Iconic behavior, ate.
Here's the part you gotta hear tho π«Ά β before you load a module that contains the package $package, you need to register it, so those special blocks get intercepted by mod_perl instead of being handed straight to Perl. That interception job belongs to special_list_register. Then, later on, when you're ready to actually execute those special blocks, you call special_list_call. And unless you're planning to call that list more than once, clear it out with special_list_clear. Boom, clean.
π API π
ModPerl::Global provides the following methods β collect them all:
π special_list_call
Call the special list, bestie. Just do it.
$ok = special_list_call($key => $package);
- arg1:
$key( string ) β the name of the special list. rn only'END'is supported, that's the only one on the guest list. - arg2:
$package( string ) β what package the special list is for - ret:
$ok( boolean ) β a true value if$keyis known, false otherwise. so like, a vibe check on your key basically. - since:
2.0.00
π§ special_list_clear
Clear the special list. Wipe it. Fresh start energy β¨
$ok = special_list_clear($key => $package);
- arg1:
$key( string ) β the name of the special list. rn only'END'is supported. - arg2:
$package( string ) β what package the special list is for - ret:
$ok( boolean ) β a true value if$keyis known, false otherwise. - since:
2.0.00
π¦ special_list_register
Register the special list. Sign it up. Put it on the list π
$ok = special_list_call($key => $package);
- arg1:
$key( string ) β the name of the special list. rn only'END'is supported. - arg2:
$package( string ) β what package the special list is for - ret:
$ok( boolean ) β a true value if$keyis known, false otherwise. - since:
2.0.00
β οΈ okay this is the important part, don't skip it: you need to register the package before it is loaded. If you register it after, Perl has already compiled the "END" blocks and they are no longer under your control. no takebacks, no redo, it's giving too late π
π«Ά SEE ALSO π«Ά
- mod_perl 2.0 documentation. that's the one, go read it π
π COPYRIGHT π
mod_perl 2.0 and its core modules are copyrighted under The Apache Software License, Version 2.0.
π AUTHORS π
The mod_perl development team and numerous contributors. absolute legends, every single one π
and that's the page bestie!! this was perl v5.42.3, dated 2026-08-20, filed under libapa...:Global(3pm) in the User Contributed Perl Documentation corner of the world. slay, go register your package before you load it, mwah π
π¦ where this page comes from
- ubuntu stonking: libapache2-mod-perl2 2.0.13-2build3 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms