Cache:...:Multi(3pm)
π Cache::Memcached::Managed::Multi π
okay so bestie, this is a page from the User Contributed Perl Documentation manual, and it's about Cache::Memcached::Managed::Multi β a lil perl module that's basically the group-chat admin of your memcached situation π
β¨ NAME β¨
Cache::Memcached::Managed::Multi β literally just multiple Cache::Memcache::Managed objects hanging out together π«Ά
πΈ SYNOPSIS πΈ
use Cache::Memcached::Managed::Multi;
my $multi = Cache::Memcached::Managed::Multi->new( @managed );
π¦ DESCRIPTION π¦
So here's the vibe: this thing gives you the exact same API as Cache::Memcached::Managed, no cap. But when you call a method on it, it applies that method to all of the objects you specified. Every single one. Slay.
The only exceptions β the two methods that do not get broadcast like that β are new and objects. Those are special, they're the main characters, they get to be themselves π
π CONTEXT π
Every method gets called on all of the Cache::Memcached::Managed objects in the same context (list, scalar, or void) that you called it on the Cache::Memcached::Managed::Multi object itself. So the context flows through, iconic behaviour honestly.
And the return value? Its format changes depending on the context too. Let's break it down:
scalar
my $listref = $multi->method;
print "Result: @{$listref}\n";
When you call it in scalar context, you get back a list ref with scalar values, returned in the same order the objects are used β and that order is determined by the order they were supplied with new and returned by objects.. β¨
list
my @listref = $multi->method;
print "Result $_: @{$listref[$_]}\n" foreach 0..$#listref;
When you call it in list context, you get back a list of list references, in the same order the objects are used β which, again, is determined by the order they were supplied with new and returned by objects. π§
void
$multi->method;
When you call it in void context, nothing is returned. Which is honestly not strange at all, the author even put a lil ;-) in there. We love a self-aware king π
π SPECIFIC CLASS METHODS π
There is only one specific class method. Just the one. A solo act. π
new
my $multi = Cache::Memcached::Managed::Multi->new( @managed );
Create an object containing multiple Cache::Memcached::Managed objects. Returns the instantiated object. That's it, that's the whole thing π
π SPECIFIC INSTANCE METHODS π
objects
my @managed = $multi->objects;
Returns the list of instantiated Cache::Memcached::Managed objects that the object is a proxy for. Basically it tells you who's in the group chat π±
π AUTHOR π
Elizabeth Mattijsen
π COPYRIGHT π
(C) 2005 - 2006 BOOKINGS (C) 2007 BOOKING.COM
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
fr fr, that warranty disclaimer is doing the most β no promises, bestie, read the license π
and that's the whole page, periodt β¨ this was perl v5.40.1, dated 2025-04-24, and it's the Cache:...:Multi(3pm) page β go forth and proxy your managed objects, you absolute icon πΈπ¦π
π¦ where this page comes from
- debian trixie: libcache-memcached-managed-perl 0.27-1 Β· GPL-2.0-or-later
- ubuntu resolute: libcache-memcached-managed-perl 0.27-1 Β· GPL-2.0-or-later
- ubuntu stonking: libcache-memcached-managed-perl 0.27-1 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms