Cache::Ref::LIFO(3pm)
π Cache::Ref::LIFO π
okay bestie, this is Cache::Ref::LIFO from the User Contributed Perl Documentation, and it is exactly what it says on the tin β a cache that saves stuff until it's full, then just... stops. no cap. let's get into it π
β¨ NAME β¨
Cache::Ref::LIFO β Saves entries until full, discarding subsequent sets.
like literally that's the whole personality. she's simple. she's honest. she's full and she's DONE accepting new entries π
π¦ SYNOPSIS π¦
my $c = Cache::Ref::LIFO->new( size => $n );
$c->set( foo => 42 );
$c->get("foo");
that's it. that's the whole API. build her with a size, set a thing, get a thing. iconic behavior, honestly πΈ
π DESCRIPTION π
so here's the tea β β this is a very naive cache algorithm. it saves cache sets until the cache is full, at which point all additional saves which aren't a value update are discarded immediately. like, dropped. on the floor. gone. π
for very predictable workflows this is potentially a good fit β provided the MFU is used early on. (iykyk β if your most-frequently-used stuff shows up first, you're eating good π)
the advantage is that the code is very simple as a result. and honestly? simple is a vibe. main character energy is knowing when NOT to overcomplicate things π
π AUTHOR π
Yuval Kogman
π COPYRIGHT AND LICENSE π
This software is copyright (c) 2010 by Yuval Kogman.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
and that's a wrap, bestie π«Ά this was documented for perl v5.32.0, dated 2021-01-07, and it lives in the User Contributed Perl Documentation corner of the universe. mwah. slay. periodt. β¨π
π¦ where this page comes from
- debian bookworm: libcache-ref-perl 0.04-1.1
- debian trixie: libcache-ref-perl 0.04-1.1
- ubuntu jammy: libcache-ref-perl 0.04-1.1
- ubuntu noble: libcache-ref-perl 0.04-1.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms