libapa...ionUtil(3pm)
β¨ NAME β¨
Apache2::ConnectionUtil β it's the Perl API for Apache connection utils, bestie π
(it lives in the User Contributed Perl Documentation section, manual page libapa...ionUtil(3pm), if you were wondering where you wandered in from)
πΈ Synopsis πΈ
use Apache2::Connection ();
use Apache2::ConnectionUtil ();
use Apache2::RequestRec ();
# grab the connection object;
my $c = $r->connection;
# share perl objects like $r->pnotes
$old_val = $c->pnotes($key => $value);
π¦ Description π¦
Apache2::ConnectionUtil hands you the utilities API for the Apache connection record object. That's the whole vibe. It's giving "connection-level goodies" π₯
π API π
Here's everything Apache2::ConnectionUtil gives you, no gatekeeping:
π pnotes
Share Perl variables between requests over the lifetime of the connection. Yes, the connection, not just one request β she persists π
$old_val = $c->pnotes($key => $val);
$val = $c->pnotes($key);
$hash_ref = $c->pnotes();
- obj:
$c( anApache2::Connection object) β your main character β¨ - opt arg1:
$key( string ) β a key value - opt arg2:
$val( SCALAR ) β any scalar value (e.g. a reference to an array). Live your life, it's flexible π - ret: three different possible values, and which one you get depends on what you handed her:
- if both
$keyand$valare passed, the previous value for$keyis returned if such existed β otherwiseundefcomes back at you π - if only
$keyis passed, the current value for the given key is returned - if no arguments are passed, a hash reference is returned, which you can then directly access without going through the
pnotes()interface. Sneaky shortcut, we love her π«Ά
- if both
- since:
2.0.3
PeepApache2::RequestUtil::pnotesfor the full details on how thepnotesmethod works β the usage is identical except for a couple of differences. First one: you use$cas the invocant instead of$r. Second one: the data persists for the lifetime of the connection instead of the lifetime of the request. So like, if the connection is lost, so is the data stored inpnotes. Gone. Poof. π Not recoverable, so don't get attached.
π See Also π
Apache2::Connection.Apache2::RequestUtil::pnotes.- mod_perl 2.0 documentation.
π 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. (The collective, fr fr π)
That's the whole page, babes β brought to you by perl v5.42.3, stamped 2026-08-20. Go forth and share your connection pnotes responsibly ππ
π¦ 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