libapa...ommand(3pm)

πŸ’– NAME πŸ’–

okay so bestie, Apache2::Command is the Perl API that lets you peek at Apache module command information. that's the whole vibe. it's giving backstage pass to the mod_perl world πŸŽ€

this page lives in the User Contributed Perl Documentation section of the manual, and yes it's a libapa...ommand(3pm) situation. iykyk πŸ’…


✨ Synopsis ✨

here's the lil taste test bestie, copy it exactly:

use Apache2::Module ();
use Apache2::Command ();
my $module = Apache2::Module::find_linked_module('mod_perl.c');

for (my $cmd = $module->cmds; $cmd; $cmd = $cmd->next) {
    $cmd->args_how();
    $cmd->errmsg();
    $cmd->name();
    $cmd->req_override();
}

see how it just… walks the command chain like a little conga line πŸ¦‹ grab the module, loop through cmds, hop to next, and ask each command the juicy questions.


🌸 Description 🌸

Apache2::Command provides the Perl API for accessing Apache module command information. that's it, that's the whole job description. it's the little lens you look through when you wanna know what a module's commands are up to πŸ”βœ¨


πŸ‘‘ API πŸ‘‘

Apache2::Command provides the following functions and/or methods (no cap, this is the full list):


πŸ’… args_how

what the command expects as arguments:

$how = $cmd->args_how();
  • obj: $cmd ( an Apache2::Command object )
  • ret: $how ( an Apache2::Const :cmd_how constant ) β€” the flag value representing the type of this command, i.e. Apache2::Const::ITERATE, Apache2::Const::TAKE2.
  • since: 2.0.00

😭 errmsg

get the usage message for that command, for when somebody typed something cursed and the syntax is broken:

$error = $cmd->errmsg();
  • obj: $cmd ( an Apache2::Command object )
  • ret: $error ( string ) β€” the error message
  • since: 2.0.00

πŸŽ€ name

get the name of this command:

$name = $cmd->name();
  • obj: $cmd ( an Apache2::Command object )
  • ret: $name ( string ) β€” the command name
  • since: 2.0.00

πŸ¦‹ next

get the next command in the chain of commands for this module. it's a linked list bestie, we love a chain:

$next = $cmd->next();
  • obj: $cmd ( an Apache2::Command object )
  • ret: $next ( an Apache2::Command object ) β€” returns the next command in the chain for this module, and undef for the last command.
  • since: 2.0.00

πŸ”₯ req_override

what overrides need to be allowed to enable this command:

$override = $cmd->req_override
  • obj: $cmd ( an Apache2::Command object )
  • ret: $override ( an Apache2::Const :override constant ) β€” the bit mask representing the overrides this command is allowed in, i.e. Apache2::Const::OR_ALL / Apache2::Const::ACCESS_CONF.
  • since: 2.0.00

for example:

use Apache2::Const -compile => qw(:override);
$cmd->req_override() & Apache2::Const::OR_AUTHCFG;
$cmd->req_override() & Apache2::Const::OR_LIMIT;

bit-masking your way through overrides, main character energy fr fr πŸ’œ


🌈 See Also 🌈

  • mod_perl 2.0 documentation.

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. iconic behavior honestly πŸ‘‘


and that's the whole page bestie, you ate it πŸ“

perl v5.42.3 Β· 2026-08-20 β€” mwah, go write something slay πŸ’–βœ¨

πŸ“¦ where this page comes from