libapa...:Const(3pm)

πŸ’… NAME πŸ’…

Apache2::Const β€” the Perl Interface for Apache Constants, aka your little box of magic Apache words πŸŽ€

✨ Synopsis ✨

okay so here's the three whole vibes you can roll with πŸ‘‡

# make the constants available but don't import them
use Apache2::Const -compile => qw(constant names ...);

# w/o the => syntax sugar
use Apache2::Const ("-compile", qw(constant names ...));

# compile and import the constants
use Apache2::Const qw(constant names ...);

🌸 Description 🌸

This package is basically a lil treasure chest of constants that are specific to Apache features. 🫢

so here's the tea bestie: mod_perl 2.0 ships with several hundreds of constants, and you do not want all of them dumped into your Perl code by default, because that's a whole CPU and memory overhead situation πŸ’€. So instead, when you want a specific constant, you have to explicitly ask for it to be made available. icon behavior honestly.

for example, this code right here:

use Apache2::Const -compile => qw(FORBIDDEN OK);

makes the constants Apache2::Const::FORBIDDEN and Apache2::Const::OK available to your code β€” but they are not imported. which means you have to use the fully qualified constant, like so:

return Apache2::Const::OK;

BUT if you drop the -compile argument and write:

use Apache2::Const qw(FORBIDDEN OK);

then both constants get imported straight into your code's namespace and you can use them standalone, like:

return OK;

ngl, both of these are kinda a lot... first because importing symbols means extra memory requirements, and second because there are constants in other namespaces (like APR:: and ModPerl::, plus non-mod_perl modules) that might contain the exact same names πŸ‘€. so importing constants is not recommended. basically, you want the -compile construct. periodt.

finally, a lil Perl moment: in Perl, => is almost the same as the comma operator. it's syntax sugar that makes it way clearer when there's a key-value relation between two arguments, and it also auto-parses its lefthand argument (the key) as a string, so you don't even need to quote it. slay.

and if that syntax isn't your vibe, instead of writing:

use Apache2::Const -compile => qw(FORBIDDEN OK);

you could write:

use Apache2::Const "-compile", qw(FORBIDDEN OK);

and for the parentheses-lovers out there πŸ™ˆ:

use Apache2::Const ("-compile", qw(FORBIDDEN OK));

πŸŽ€ Constants πŸŽ€

:cmd_how

use Apache2::Const -compile => qw(:cmd_how);

The :cmd_how constants group is the one used by Apache2::Module::add() and $cmds->args_how. πŸ’…

  • Apache2::Const::FLAG β€” One of On or Off (full description). since: 2.0.00
  • Apache2::Const::ITERATE β€” One argument, occurring multiple times (full description). since: 2.0.00
  • Apache2::Const::ITERATE2 β€” Two arguments, the second occurs multiple times (full description). since: 2.0.00
  • Apache2::Const::NO_ARGS β€” No arguments at all (full description). since: 2.0.00
  • Apache2::Const::RAW_ARGS β€” The command will parse the command line itself (full description). since: 2.0.00
  • Apache2::Const::TAKE1 β€” One argument only (full description). since: 2.0.00
  • Apache2::Const::TAKE12 β€” One or two arguments (full description). since: 2.0.00
  • Apache2::Const::TAKE123 β€” One, two or three arguments (full description). since: 2.0.00
  • Apache2::Const::TAKE13 β€” One or three arguments (full description). since: 2.0.00
  • Apache2::Const::TAKE2 β€” Two arguments (full description). since: 2.0.00
  • Apache2::Const::TAKE23 β€” Two or three arguments (full description). since: 2.0.00
  • Apache2::Const::TAKE3 β€” Three arguments (full description). since: 2.0.00

:common

use Apache2::Const -compile => qw(:common);

The :common group is for XXX constants. πŸ¦‹

  • Apache2::Const::AUTH_REQUIRED since: 2.0.00
  • Apache2::Const::DECLINED since: 2.0.00
  • Apache2::Const::DONE since: 2.0.00
  • Apache2::Const::FORBIDDEN since: 2.0.00
  • Apache2::Const::NOT_FOUND since: 2.0.00
  • Apache2::Const::OK since: 2.0.00
  • Apache2::Const::REDIRECT since: 2.0.00
  • Apache2::Const::SERVER_ERROR since: 2.0.00

:config

use Apache2::Const -compile => qw(:config);

The :config group is for XXX constants. 🌈

  • Apache2::Const::DECLINE_CMD since: 2.0.00

:conn_keepalive

use Apache2::Const -compile => qw(:conn_keepalive);

The :conn_keepalive constants group is the one used by the $c->keepalive method. ✨

  • Apache2::Const::CONN_CLOSE β€” The connection will be closed at the end of the current HTTP request. since: 2.0.00
  • Apache2::Const::CONN_KEEPALIVE β€” The connection will be kept alive at the end of the current HTTP request. since: 2.0.00
  • Apache2::Const::CONN_UNKNOWN β€” The connection is at an unknown state, e.g., initialized but not open yet. since: 2.0.00

:context

use Apache2::Const -compile => qw(:context);

The :context group is used by the $parms->check_cmd_context method. πŸ’œ

  • Apache2::Const::NOT_IN_VIRTUALHOST β€” The command is not in a <VirtualHost> block. since: 2.0.00
  • Apache2::Const::NOT_IN_LIMIT β€” The command is not in a <Limit> block. since: 2.0.00
  • Apache2::Const::NOT_IN_DIRECTORY β€” The command is not in a <Directory> block. since: 2.0.00
  • Apache2::Const::NOT_IN_LOCATION β€” The command is not in a <Location>/<LocationMatch> block. since: 2.0.00
  • Apache2::Const::NOT_IN_FILES β€” The command is not in a <Files>/<FilesMatch> block. since: 2.0.00
  • Apache2::Const::NOT_IN_DIR_LOC_FILE β€” The command is not in a <Files>/<FilesMatch>, <Location>/<LocationMatch> or <Directory> block. since: 2.0.00
  • Apache2::Const::GLOBAL_ONLY β€” The directive appears outside of any container directives. since: 2.0.00

:filter_type

use Apache2::Const -compile => qw(:filter_type);

The :filter_type group is for XXX constants. 🧚

  • Apache2::Const::FTYPE_CONNECTION since: 2.0.00
  • Apache2::Const::FTYPE_CONTENT_SET since: 2.0.00
  • Apache2::Const::FTYPE_NETWORK since: 2.0.00
  • Apache2::Const::FTYPE_PROTOCOL since: 2.0.00
  • Apache2::Const::FTYPE_RESOURCE since: 2.0.00
  • Apache2::Const::FTYPE_TRANSCODE since: 2.0.00

:http

use Apache2::Const -compile => qw(:http);

The :http group is for XXX constants. ⭐

  • Apache2::Const::HTTP_ACCEPTED since: 2.0.00
  • Apache2::Const::HTTP_BAD_GATEWAY since: 2.0.00
  • Apache2::Const::HTTP_BAD_REQUEST since: 2.0.00
  • Apache2::Const::HTTP_CONFLICT since: 2.0.00
  • Apache2::Const::HTTP_CONTINUE since: 2.0.00
  • Apache2::Const::HTTP_CREATED since: 2.0.00
  • Apache2::Const::HTTP_EXPECTATION_FAILED since: 2.0.00
  • Apache2::Const::HTTP_FAILED_DEPENDENCY since: 2.0.00
  • Apache2::Const::HTTP_FORBIDDEN since: 2.0.00
  • Apache2::Const::HTTP_GATEWAY_TIME_OUT since: 2.0.00
  • Apache2::Const::HTTP_GONE since: 2.0.00
  • Apache2::Const::HTTP_INSUFFICIENT_STORAGE since: 2.0.00
  • Apache2::Const::HTTP_INTERNAL_SERVER_ERROR since: 2.0.00
  • Apache2::Const::HTTP_LENGTH_REQUIRED since: 2.0.00
  • Apache2::Const::HTTP_LOCKED since: 2.0.00
  • Apache2::Const::HTTP_METHOD_NOT_ALLOWED since: 2.0.00
  • Apache2::Const::HTTP_MOVED_PERMANENTLY since: 2.0.00
  • Apache2::Const::HTTP_MOVED_TEMPORARILY since: 2.0.00
  • Apache2::Const::HTTP_MULTIPLE_CHOICES since: 2.0.00
  • Apache2::Const::HTTP_MULTI_STATUS since: 2.0.00
  • Apache2::Const::HTTP_NON_AUTHORITATIVE since: 2.0.00
  • Apache2::Const::HTTP_NOT_ACCEPTABLE since: 2.0.00
  • Apache2::Const::HTTP_NOT_EXTENDED since: 2.0.00
  • Apache2::Const::HTTP_NOT_FOUND since: 2.0.00
  • Apache2::Const::HTTP_NOT_IMPLEMENTED since: 2.0.00
  • Apache2::Const::HTTP_NOT_MODIFIED since: 2.0.00
  • Apache2::Const::HTTP_NO_CONTENT since: 2.0.00
  • Apache2::Const::HTTP_OK since: 2.0.00
  • Apache2::Const::HTTP_PARTIAL_CONTENT since: 2.0.00
  • Apache2::Const::HTTP_PAYMENT_REQUIRED since: 2.0.00
  • Apache2::Const::HTTP_PRECONDITION_FAILED since: 2.0.00
  • Apache2::Const::HTTP_PROCESSING since: 2.0.00
  • Apache2::Const::HTTP_PROXY_AUTHENTICATION_REQUIRED since: 2.0.00
  • Apache2::Const::HTTP_RANGE_NOT_SATISFIABLE since: 2.0.00
  • Apache2::Const::HTTP_REQUEST_ENTITY_TOO_LARGE since: 2.0.00
  • Apache2::Const::HTTP_REQUEST_TIME_OUT since: 2.0.00
  • Apache2::Const::HTTP_REQUEST_URI_TOO_LARGE since: 2.0.00
  • Apache2::Const::HTTP_RESET_CONTENT since: 2.0.00
  • Apache2::Const::HTTP_SEE_OTHER since: 2.0.00
  • Apache2::Const::HTTP_SERVICE_UNAVAILABLE since: 2.0.00
  • Apache2::Const::HTTP_SWITCHING_PROTOCOLS since: 2.0.00
  • Apache2::Const::HTTP_TEMPORARY_REDIRECT since: 2.0.00
  • Apache2::Const::HTTP_UNAUTHORIZED since: 2.0.00
  • Apache2::Const::HTTP_UNPROCESSABLE_ENTITY since: 2.0.00
  • Apache2::Const::HTTP_UNSUPPORTED_MEDIA_TYPE since: 2.0.00
  • Apache2::Const::HTTP_UPGRADE_REQUIRED since: 2.0.00
  • Apache2::Const::HTTP_USE_PROXY since: 2.0.00
  • Apache2::Const::HTTP_VARIANT_ALSO_VARIES since: 2.0.00

:input_mode

use Apache2::Const -compile => qw(:input_mode);

The :input_mode group is used by get_brigade. πŸ“

  • Apache2::Const::MODE_EATCRLF since: 2.0.00

See Apache2::Filter::get_brigade().

  • Apache2::Const::MODE_EXHAUSTIVE since: 2.0.00

See Apache2::Filter::get_brigade().

  • Apache2::Const::MODE_GETLINE since: 2.0.00

See Apache2::Filter::get_brigade().

  • Apache2::Const::MODE_INIT since: 2.0.00

See Apache2::Filter::get_brigade().

  • Apache2::Const::MODE_READBYTES since: 2.0.00

See Apache2::Filter::get_brigade().

  • Apache2::Const::MODE_SPECULATIVE since: 2.0.00

See Apache2::Filter::get_brigade().

:log

use Apache2::Const -compile => qw(:log);

The :log group is for constants used by Apache2::Log. πŸ’–

  • Apache2::Const::LOG_ALERT since: 2.0.00

See Apache2::Log.

  • Apache2::Const::LOG_CRIT since: 2.0.00

See Apache2::Log.

  • Apache2::Const::LOG_DEBUG since: 2.0.00

See Apache2::Log.

  • Apache2::Const::LOG_EMERG since: 2.0.00

See Apache2::Log.

  • Apache2::Const::LOG_ERR since: 2.0.00

See Apache2::Log.

  • Apache2::Const::LOG_INFO since: 2.0.00

See Apache2::Log.

  • Apache2::Const::LOG_LEVELMASK since: 2.0.00

See Apache2::Log.

  • Apache2::Const::LOG_NOTICE since: 2.0.00

See Apache2::Log.

  • Apache2::Const::LOG_STARTUP since: 2.0.00

See Apache2::Log.

  • Apache2::Const::LOG_TOCLIENT since: 2.0.00

See Apache2::Log.

  • Apache2::Const::LOG_WARNING

since: 2.0.00 ✨ and yep, that one's all documented over in Apache2::Log β€” go peek bestie πŸ’–


πŸŽ€ :methods πŸŽ€

use Apache2::Const -compile => qw(:methods);

okay so the :methods constant group is the one you pull in when you're doing stuff with $r->method_number 🫢 like, they're a set, you use them together, that's the vibe.

  • Apache2::Const::METHODS β€” since: 2.0.00 🌸
  • Apache2::Const::M_BASELINE_CONTROL β€” since: 2.0.00 🌸
  • Apache2::Const::M_CHECKIN β€” since: 2.0.00 🌸
  • Apache2::Const::M_CHECKOUT β€” since: 2.0.00 🌸
  • Apache2::Const::M_CONNECT β€” since: 2.0.00 🌸
  • Apache2::Const::M_COPY β€” since: 2.0.00 🌸
  • Apache2::Const::M_DELETE β€” since: 2.0.00 🌸
  • Apache2::Const::M_GET β€” since: 2.0.00 🌸 β€” this one is the HTTP GET method, the one you already know and love πŸ’…
  • Apache2::Const::M_INVALID β€” since: 2.0.00 🌸
  • Apache2::Const::M_LABEL β€” since: 2.0.00 🌸
  • Apache2::Const::M_LOCK β€” since: 2.0.00 🌸
  • Apache2::Const::M_MERGE β€” since: 2.0.00 🌸
  • Apache2::Const::M_MKACTIVITY β€” since: 2.0.00 🌸
  • Apache2::Const::M_MKCOL β€” since: 2.0.00 🌸
  • Apache2::Const::M_MKWORKSPACE β€” since: 2.0.00 🌸
  • Apache2::Const::M_MOVE β€” since: 2.0.00 🌸
  • Apache2::Const::M_OPTIONS β€” since: 2.0.00 🌸
  • Apache2::Const::M_PATCH β€” since: 2.0.00 🌸
  • Apache2::Const::M_POST β€” since: 2.0.00 🌸 β€” and this is the HTTP POST method, iconic behavior truly πŸ‘‘
  • Apache2::Const::M_PROPFIND β€” since: 2.0.00 🌸
  • Apache2::Const::M_PROPPATCH β€” since: 2.0.00 🌸
  • Apache2::Const::M_PUT β€” since: 2.0.00 🌸 β€” the HTTP PUT method, slay πŸ’…
  • Apache2::Const::M_REPORT β€” since: 2.0.00 🌸
  • Apache2::Const::M_TRACE β€” since: 2.0.00 🌸
  • Apache2::Const::M_UNCHECKOUT β€” since: 2.0.00 🌸
  • Apache2::Const::M_UNLOCK β€” since: 2.0.00 🌸
  • Apache2::Const::M_UPDATE β€” since: 2.0.00 🌸
  • Apache2::Const::M_VERSION_CONTROL β€” since: 2.0.00 🌸

πŸ¦‹ :mpmq πŸ¦‹

use Apache2::Const -compile => qw(:mpmq);

the :mpmq group?? okay so this is your little toolkit for querying MPM properties β€” like asking your server "bestie, how are you built? thread-y? fork-y? how many of you are there?" ✨

  • Apache2::Const::MPMQ_NOT_SUPPORTED β€” since: 2.0.00 πŸ’œ
  • Apache2::Const::MPMQ_STATIC β€” since: 2.0.00 πŸ’œ
  • Apache2::Const::MPMQ_DYNAMIC β€” since: 2.0.00 πŸ’œ
  • Apache2::Const::MPMQ_MAX_DAEMON_USED β€” since: 2.0.00 πŸ’œ
  • Apache2::Const::MPMQ_IS_THREADED β€” since: 2.0.00 πŸ’œ
  • Apache2::Const::MPMQ_IS_FORKED β€” since: 2.0.00 πŸ’œ
  • Apache2::Const::MPMQ_HARD_LIMIT_DAEMONS β€” since: 2.0.00 πŸ’œ
  • Apache2::Const::MPMQ_HARD_LIMIT_THREADS β€” since: 2.0.00 πŸ’œ
  • Apache2::Const::MPMQ_MAX_THREADS β€” since: 2.0.00 πŸ’œ
  • Apache2::Const::MPMQ_MIN_SPARE_DAEMONS β€” since: 2.0.00 πŸ’œ
  • Apache2::Const::MPMQ_MIN_SPARE_THREADS β€” since: 2.0.00 πŸ’œ
  • Apache2::Const::MPMQ_MAX_SPARE_DAEMONS β€” since: 2.0.00 πŸ’œ
  • Apache2::Const::MPMQ_MAX_SPARE_THREADS β€” since: 2.0.00 πŸ’œ
  • Apache2::Const::MPMQ_MAX_REQUESTS_DAEMON β€” since: 2.0.00 πŸ’œ
  • Apache2::Const::MPMQ_MAX_DAEMONS β€” since: 2.0.00 πŸ’œ

🌈 :options 🌈

use Apache2::Const -compile => qw(:options);

so the :options group is literally the constants that match up with the Options configuration directive ✨ you want examples? go look at $r->allow_options, they got you 🫢

  • Apache2::Const::OPT_ALL β€” since: 2.0.00 🌸
  • Apache2::Const::OPT_EXECCGI β€” since: 2.0.00 🌸
  • Apache2::Const::OPT_INCLUDES β€” since: 2.0.00 🌸
  • Apache2::Const::OPT_INCNOEXEC β€” since: 2.0.00 🌸
  • Apache2::Const::OPT_INDEXES β€” since: 2.0.00 🌸
  • Apache2::Const::OPT_MULTI β€” since: 2.0.00 🌸
  • Apache2::Const::OPT_NONE β€” since: 2.0.00 🌸
  • Apache2::Const::OPT_SYM_LINKS β€” since: 2.0.00 🌸
  • Apache2::Const::OPT_SYM_OWNER β€” since: 2.0.00 🌸
  • Apache2::Const::OPT_UNSET β€” since: 2.0.00 🌸

πŸ’… :override πŸ’…

use Apache2::Const -compile => qw(:override);

okay the :override group is the constants for the AllowOverride configuration directive πŸ‘‘ and fr, if you want examples just go see $r->allow_options, it's right there.

  • Apache2::Const::ACCESS_CONF β€” the *.conf inside <Directory> or <Location> β€” since: 2.0.00 πŸŽ€
  • Apache2::Const::EXEC_ON_READ β€” force a directive to execute a command that would modify the configuration (like including another file, or IFModule) β€” since: 2.0.00 πŸŽ€
  • Apache2::Const::OR_ALL β€” it's Apache2::Const::OR_LIMIT | Apache2::Const::OR_OPTIONS | Apache2::Const::OR_FILEINFO | Apache2::Const::OR_AUTHCFG | Apache2::Const::OR_INDEXES β€” since: 2.0.00 πŸŽ€
  • Apache2::Const::OR_AUTHCFG β€” *.conf inside <Directory> or <Location> and .htaccess when AllowOverride AuthConfig β€” since: 2.0.00 πŸŽ€
  • Apache2::Const::OR_FILEINFO β€” *.conf anywhere and .htaccess when AllowOverride FileInfo β€” since: 2.0.00 πŸŽ€
  • Apache2::Const::OR_INDEXES β€” *.conf anywhere and .htaccess when AllowOverride Indexes β€” since: 2.0.00 πŸŽ€
  • Apache2::Const::OR_LIMIT β€” *.conf inside <Directory> or <Location> and .htaccess when AllowOverride Limit β€” since: 2.0.00 πŸŽ€
  • Apache2::Const::OR_NONE β€” *.conf is not available anywhere in this override β€” since: 2.0.00 πŸŽ€
  • Apache2::Const::OR_OPTIONS β€” *.conf anywhere and .htaccess when AllowOverride Options β€” since: 2.0.00 πŸŽ€
  • Apache2::Const::OR_UNSET β€” unset a directive (in Allow) β€” since: 2.0.00 πŸŽ€
  • Apache2::Const::RSRC_CONF β€” *.conf outside <Directory> or <Location> β€” since: 2.0.00 πŸŽ€

🧚 :platform 🧚

use Apache2::Const -compile => qw(:platform);

the :platform group is for constants that might differ from OS to OS 😭 so like, your mileage may literally vary depending on the machine you're on, and that's the point of them.

  • Apache2::Const::CRLF β€” since: 2.0.00 🌸
  • Apache2::Const::CR β€” since: 2.0.00 🌸
  • Apache2::Const::LF β€” since: 2.0.00 🌸

πŸ“ :remotehost πŸ“

use Apache2::Const -compile => qw(:remotehost);

the :remotehost constants group (yes the original says "is is", we stan a typo, but it's fine) gets used by the $c->get_remote_host method πŸ’– you bring these along whenever you're asking about where somebody's connecting from.

  • Apache2::Const::REMOTE_DOUBLE_REV β€” since: 2.0.00 🌸
  • Apache2::Const::REMOTE_HOST β€” since: 2.0.00 🌸
  • Apache2::Const::REMOTE_NAME β€” since: 2.0.00 🌸
  • Apache2::Const::REMOTE_NOLOOKUP β€” since: 2.0.00 🌸

⭐ :satisfy ⭐

use Apache2::Const -compile => qw(:satisfy);

the :satisfy constants group is the buddy of $r->satisfies 🫢 like, it answers "did we do enough to let this request through or nah?"

  • Apache2::Const::SATISFY_ALL β€” since: 2.0.00 🌸 β€” all of the requirements must be met πŸ”₯
  • Apache2::Const::SATISFY_ANY β€” since: 2.0.00 🌸 β€” any of the requirements must be met πŸ’« (yes, lowercase "any" in the original, we keep it, it's cute)
  • Apache2::Const::SATISFY_NOSPEC β€” since: 2.0.00 🌸 β€” there are no applicable satisfy lines 🫠

πŸ‘‘ :types πŸ‘‘

use Apache2::Const -compile => qw(:types);

the :types group is for XXX constants 😭 like, that's literally what the docs say. XXX. we don't ask questions, we just import the group bestie.

  • Apache2::Const::DIR_MAGIC_TYPE β€” since: 2.0.00 🌸

πŸ’œ :proxy πŸ’œ

use Apache2::Const -compile => qw(:proxy);

the :proxy constants group hangs out with $r->proxyreq ✨ perfect for when you need to know if a request is a proxy request and which flavor of proxy it is.

  • Apache2::Const::PROXYREQ_NONE β€” since: 2.0.2 πŸ¦‹
  • Apache2::Const::PROXYREQ_PROXY β€” since: 2.0.2 πŸ¦‹
  • Apache2::Const::PROXYREQ_REVERSE β€” since: 2.0.2 πŸ¦‹
  • Apache2::Const::PROXYREQ_RESPONSE β€” since: 2.0.5 πŸ¦‹ (yes bestie, a different version number, don't @ me, that's just what it says)

🌸 SEE ALSO (but make it a vibe) 🌸

  • mod_perl 2.0 documentation β€” go read it, it's giving scholarly πŸ’…
  • HTTP Status Codes β€” also a read, also important, no cap πŸ“š

mod_perl 2.0 and its core modules are copyrighted under The Apache Software License, Version 2.0 βš–οΈ (yes we're being serious here, credit where credit's due, always)


πŸ’– Authors πŸ’–

The mod_perl development team and numerous contributors πŸ‘‘πŸŒˆ legendary behavior, honestly, they ate and left no crumbs.


okay and for the lil sign-off moment: this whole page is perl v5.42.3, dated 2026-08-20, and it's libapa...:Const(3pm) β€” the user contributed Perl documentation, Perl version 5.42.3, dated 2026-08-20 🫢 that's the footer, that's the tea, go forth and import your constants bestie βœ¨πŸ’…

πŸ“¦ where this page comes from