# perldoc > Cache::Memory

---
type: CommandReference
command: Cache::Memory
mode: perldoc
section: 
source: perldoc
---

## Quick Reference

- `Cache::Memory->new( namespace => 'MyNamespace', default_expires => '600 sec' )` — create a new memory cache instance
- `$cache->namespace()` — get current namespace
- `$cache->set_namespace($namespace)` — set namespace for cache operations

## Name

Memory based implementation of the Cache interface

## Synopsis

perl
use Cache::Memory;

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

No options specific to Cache::Memory beyond the `namespace` property. See Cache for inherited properties.

- `namespace` — specify a different caching store area. All methods work only on the namespace specified.

## See Also

- [Cache](https://metacpan.org/pod/Cache) — base interface