Arch::...edCache(3pm)
β¨ Arch::SharedCache β the perl doc page π
okay bestie, gather round, because this is Arch::...edCache(3pm) from the User Contributed Perl Documentation and it is lowkey iconic. it's a synchronized data structure (a map, bestie, a map) for IPC. yes we love inter-process communication in this house π«Ά
πΈ NAME πΈ
Arch::SharedCache β a synchronized data structure (map) for IPC β¨
π SYNOPSIS π
use Arch::SharedCache;
my $cache = Arch::SharedCache->new(
dir => '/tmp/dir-listings',
max_size => 100,
expiration => 600, # 10 minutes
);
sub ls_long { scalar `ls -l $_[0]` }
my $user_dir = '/usr/share';
$cache->store($user_dir => ls_long($user_dir));
$cache->fetch_store(sub { ls_long($_[0]) }, qw(/tmp /bin /usr/share));
printf "Cached listing of $user_dir:\n%s", $cache->fetch($user_dir);
$cache->delete($user_dir);
# examine /tmp/dir-listings/ after running this script
# see also synopsys of Arch::SharedIndex
likeβ¦ run this script and then literally go poke around /tmp/dir-listings/ with your own two eyes, it's giving main character investigates her own cache π
π¦ DESCRIPTION π¦
so here's the vibe: Arch::SharedCache provides an Arch::SharedIndex implementation that uses a single file per value. one value, one file. that's it. that's the whole personality. no cap π
π METHODS π
the following methods are available:
newβ the constructor, obviously. she's the moment.
other methods are documented in Arch::SharedIndex. not me gatekeeping the rest of the methods by pointing you at a different manpage π go read it bestie.
π new options π
create a new Arch::SharedCache object. options is a hash of options. like, an actual hash, of options. options-ception fr fr.
dirβ the cache directory used to store data. will be created if it doesn't exist. she makes herself at home, we love a self-sufficient queen πindex_fileβ name of the index file for the cache. defaults to"dir/.index". yes, that'sdirslash.index, note the dot, note the slashes, copy it exactly please π
π BUGS π
awaiting for your reports.
(that's it. that's the bug section. the bug is that there are no bugs reported yet and she is awaiting. the suspense is giving thriller movie π)
π AUTHORS π
- Mikhael Goikhman (
migo@homemail.com--Perl-GPL/arch-perl--devel). π - Enno Cramer (
uebergeek@web.de--2003/arch-perl--devel). π
two absolute legends, we stan, periodt.
π SEE ALSO π
for more information, see Arch::SharedIndex. (iykyk π)
okay and finally, the cute little sign-off: this page is from perl v5.20.2, dated 2005-09-17, and it lives under the title Arch::...edCache(3pm) π¦β¨ mwah, go cache something responsibly bestie π«Ά
π¦ where this page comes from
- ubuntu jammy: libarch-perl 0.5.2-2 Β· 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