DBI::Util::CacheMemory - a very fast but very minimal subset of Cache::Memory
| Use Case | Command | Description |
|---|---|---|
| Create a cache | my $cache = DBI::Util::CacheMemory->new(namespace => 'mycache') |
Create a new cache instance with a namespace |
| Store a value | $cache->set('key', 'value') |
Store a value indefinitely (no expiry support) |
| Check if key exists | $cache->exists('key') |
Returns true if key exists |
| Remove a key | $cache->remove('key') |
Remove a specific key |
| Get count of keys | $cache->count() |
Return number of keys in cache |
| Clear all entries | $cache->clear() |
Remove all entries from the cache |
| Purge (same as clear) | $cache->purge() |
Alias for clear, deletes everything in namespace |
Like Cache::Memory (part of the Cache distribution) but doesn't support any fancy features.
This module aims to be a very fast compatible strict sub-set for simple cases, such as basic client-side caching for DBD::Gofer.
Like Cache::Memory, and other caches in the Cache and Cache::Cache distributions, the data will remain in the cache until cleared, it expires, or the process dies. The cache object simply going out of scope will not destroy the data.
All options except "namespace" are ignored.
Doesn't support expiry.
Same as clear() - deletes everything in the namespace.
clearcountexistsremoveIf it's not listed above, it's not supported.
perl v5.34.0 2026-06-22 DBI::Util::CacheMemory(3pm)
```Generated by phpman v4.9.26-5-g7740029 Author: Che Dong Under GNU General Public License
2026-08-14 20:12 @2600:1f28:365:80b0:4d23:66fa:c2bb:7bae
CrawledBy CCBot/2.0 (https://commoncrawl.org/faq/)