Cache::Object – the data stored in a Cache.
| Use Case | Command | Description |
|---|---|---|
| Create a new object | my $obj = new Cache::Object(); | 🐣 Constructs an empty data wrapper |
| Set the cache key | $obj->set_key($key) | 🔑 Assigns the lookup key |
| Store data | $obj->set_data($data) | 📦 Places a scalar or reference into the object |
| Set expiry time | $obj->set_expires_at($time) | ⏳ Determines when the entry should expire |
| Record creation time | $obj->set_created_at($time) | 🕒 Marks when the object was created |
| Get stored data | $data = $obj->get_data() | 📤 Retrieves the stored data |
| Get expiration | $time = $obj->get_expires_at() | ⏰ Checks when the entry expires |
Object is used by classes implementing the Cache interface as an object oriented wrapper around the data. End users will not normally use Object directly, but it can be retrieved via the get_object method on the Cache::Cache interface.
use Cache::Object;
my $object = new Cache::Object( );
$object->set_key( $key );
$object->set_data( $data );
$object->set_expires_at( $expires_at );
$object->set_created_at( $created_at );
Construct a new Cache::Object.
Each property is accessed via get_name and set_name methods.
accessed_at property to store information for LRU algorithms. There is no guarantee that all caches will update this field, however.Original author: DeWitt Clinton <dewitt AT unto.net>
Last author: $Author: dclinton $
Copyright (C) 2001-2003 DeWitt Clinton
Generated by phpman v4.9.27 · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-07-18 18:08 @2600:1f28:365:80b0:f8a4:e764:d6bb:8e66
CrawledBy CCBot/2.0 (https://commoncrawl.org/faq/)
Enhanced by LLM: deepseek-v4-flash / taotoken.net / www.chedong.com - original format