docs::a...2::Const(3)

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

πŸ’– NAME πŸ’–

okay bestie, this is Apache2::Const β€” literally the Perl interface for Apache constants, from the docs::a...2::Const(3) manual page. It's the constants closet for mod_perl 2.0 Apache features. πŸŽ€

✨ Synopsis ✨

Three ways to summon the constants, queen:

# 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 where constants specific to Apache features live. πŸ’…

mod_perl 2.0 comes with several hundreds of constants, and you do not want to make all of them available to your Perl code by default β€” the CPU and memory overhead would be giving unnecessary main-character chaos. So when you want a certain constant, you need to explicitly ask to make it available. ✨

For example, this code:

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

makes the constants Apache2::Const::FORBIDDEN and Apache2::Const::OK available to your code, but they aren't imported. In which case you need to use fully qualified constants, as in:

return Apache2::Const::OK;

If you drop the argument -compile and write:

use Apache2::Const qw(FORBIDDEN OK);

then both constants are imported into your code's namespace and can be used standalone like so:

return OK;

Both β€” because of the extra memory requirement when importing symbols, and because there are constants in other namespaces (e.g., APR:: and ModPerl::, and non-mod_perl modules) which may contain the same names β€” it's not recommended to import constants. I.e. you want to use the -compile construct. 🫢

Finally, in Perl => is almost the same as the comma operator. It can be used as syntax sugar, making it more clear when there is a key-value relation between two arguments, and it also automatically parses its lefthand argument (the key) as a string, so you don't need to quote it. πŸ’–

If you don't want to use that syntax, instead of writing:

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

you could write:

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

and for parentheses-lovers:

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

πŸ¦‹ Constants πŸ¦‹

πŸŽ€ :cmd_how πŸŽ€

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

The :cmd_how constants group is used in 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. (Yes, the docs literally say XXX, and we respect the icon.) πŸ’€

  • 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 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
  • and yeah, that one's since: 2.0.00 too, obvs πŸ’…

Anyway β€” for the full tea on that group, go read Apache2::Log. It's right there, bestie 🫢


✨ the :methods group ✨

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

These ones go hand in hand with $r->method_number β€” like, that's their whole thing πŸ’–

  • 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 corresponds to the HTTP GET method πŸ‘‘
  • 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 β€” corresponds to the HTTP POST method, slay πŸŽ€
  • Apache2::Const::M_PROPFIND β€” since: 2.0.00
  • Apache2::Const::M_PROPPATCH β€” since: 2.0.00
  • Apache2::Const::M_PUT β€” since: 2.0.00 β€” corresponds to the HTTP PUT method, periodt πŸ”₯
  • 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

🌸 the :mpmq group 🌸

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

This whole group is for querying MPM properties β€” like asking your server "bestie, how are you built?" 🧚

  • 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

πŸ¦‹ the :options group πŸ¦‹

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

These constants mirror the Options configuration directive, fr fr. Want actual examples? Peep $r->allow_options πŸ‘€

  • 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

πŸ’œ the :override group πŸ’œ

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

Same deal but for the AllowOverride configuration directive. Examples? Again: $r->allow_options πŸ’…

  • Apache2::Const::ACCESS_CONF β€” *.conf inside <Directory> or <Location> β€” since: 2.0.00
  • Apache2::Const::EXEC_ON_READ β€” forces 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 β€” this icon is literally the combo of 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>, plus .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>, plus .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 β€” unsets a directive (in Allow) β€” since: 2.0.00
  • Apache2::Const::RSRC_CONF β€” *.conf outside <Directory> or <Location> β€” since: 2.0.00

🌈 the :platform group 🌈

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

These are the "it depends on your OS bestie" constants β€” genuinely varies from OS to OS 🫢

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

⭐ the :remotehost group ⭐

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

(okay the original says "is is used by", and we are not fixing it, we're just appreciating it 😭) β€” these get used by the $c->get_remote_host method.

  • 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

πŸŽ€ the :satisfy group πŸŽ€

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

Buddies with $r->satisfies. It's giving "are we satisfied or not" energy ✨

  • Apache2::Const::SATISFY_ALL β€” since: 2.0.00 β€” every single requirement has to be met, no skipping πŸ™…
  • Apache2::Const::SATISFY_ANY β€” since: 2.0.00 β€” any one of the requirements must be met
  • Apache2::Const::SATISFY_NOSPEC β€” since: 2.0.00 β€” there are no applicable satisfy lines

πŸ”₯ the :types group πŸ”₯

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

Yep, the original literally calls these "XXX constants" and we're keeping that exactly as-is πŸ˜­πŸ’€

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

πŸ‘‘ the :proxy group πŸ‘‘

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

These live for $r->proxyreq β€” proxy vibes only πŸ’…

  • 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

πŸ¦‹ See Also πŸ¦‹

  • mod_perl 2.0 documentation.
  • HTTP Status Codes.

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.


okay that's the whole page bestie, go forth and constant-ify ✨ this was perl v5.42.3, dated 2023-10-21, page docs::a...2::Const(3) β€” main character documentation energy, no cap πŸ’œπŸŽ€

πŸ“¦ where this page comes from