perldoc > Cache::Memory

🏷️ NAME

Cache::Memory β€” Memory based implementation of the Cache interface

πŸš€ Quick Reference

Use Case Command Description
Create a memory cache Cache::Memory->new( namespace => 'MyNamespace', default_expires => '600 sec' ) Initializes a per‑process memory cache with a namespace and default expiration
Set namespace $cache->set_namespace( $namespace ) Changes the cache store area; all methods work only on this namespace
Get namespace my $ns = $cache->namespace() Returns the current namespace of the cache

πŸ“‹ SYNOPSIS

use Cache::Memory;

my $cache = Cache::Memory->new( namespace => 'MyNamespace',
                                default_expires => '600 sec' );

See Cache for the usage synopsis.

πŸ“– DESCRIPTION

The Cache::Memory class implements the Cache interface. This cache stores data on a per‑process basis. This is the fastest of the cache implementations, but is memory intensive and data cannot be shared between processes. It also does not persist after the process dies. However data will remain in the cache until cleared or it expires. The data will be shared between instances of the cache object, a cache object going out of scope will not destroy the data.

πŸ› οΈ CONSTRUCTOR

my $cache = Cache::Memory->new( %options )

The constructor takes cache properties as named arguments, for example:

my $cache = Cache::Memory->new( namespace => 'MyNamespace',
                                default_expires => '600 sec' );

See PROPERTIES below and in the Cache documentation for a list of all available properties that can be set.

βš™οΈ METHODS

See Cache for the API documentation.

πŸ”§ PROPERTIES

Cache::Memory adds the property namespace, which allows you to specify a different caching store area to use from the default. All methods will work ONLY on the namespace specified.

my $ns = $cache->namespace();
$cache->set_namespace( $namespace );

For additional properties, see the Cache documentation.

πŸ”— SEE ALSO

Cache

πŸ‘€ AUTHOR

Chris Leishman <chris AT leishman.org>
Based on work by DeWitt Clinton <dewitt AT unto.net>

©️ COPYRIGHT

Copyright (C) 2003-2006 Chris Leishman. All Rights Reserved.

This module is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either expressed or implied. This program is free software; you can redistribute or modify it under the same terms as Perl itself.

$Id: Memory.pm,v 1.9 2006/01/31 15:23:58 caleishm Exp $

Cache::Memory
🏷️ NAME πŸš€ Quick Reference πŸ“‹ SYNOPSIS πŸ“– DESCRIPTION πŸ› οΈ CONSTRUCTOR βš™οΈ METHODS πŸ”§ PROPERTIES πŸ”— SEE ALSO πŸ‘€ AUTHOR ©️ COPYRIGHT

Generated by phpman v4.9.26-5-g7740029 · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-08-24 16:07 @216.73.217.23
CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
Valid XHTML 1.0 Transitional!Valid CSS!