• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

benchmark/H07-Apr-2014-118100

inc/Module/H07-Apr-2014-2,0411,527

lib/Cache/H07-Apr-2014-15970

t/H07-Apr-2014-9772

.gitignoreH A D24-Nov-2010174 2221

ChangesH A D07-Apr-2014296 149

MANIFESTH A D07-Apr-2014399 2019

META.ymlH A D07-Apr-2014573 2827

Makefile.PLH A D25-Nov-2010168 106

READMEH A D07-Apr-20141.3 KiB5637

README

1NAME
2    Cache::LRU - a simple, fast implementation of LRU cache in pure perl
3
4SYNOPSIS
5        use Cache::LRU;
6
7        my $cache = Cache::LRU->new(
8            size => $max_num_of_entries,
9        );
10
11        $cache->set($key => $value);
12
13        $value = $cache->get($key);
14
15        $removed_value = $cache->remove($key);
16
17DESCRIPTION
18    Cache::LRU is a simple, fast implementation of an in-memory LRU cache in
19    pure perl.
20
21FUNCTIONS
22  Cache::LRU->new(size => $max_num_of_entries)
23    Creates a new cache object. Takes a hash as the only argument. The only
24    parameter currently recognized is the "size" parameter that specifies
25    the maximum number of entries to be stored within the cache object.
26
27  $cache->get($key)
28    Returns the cached object if exists, or undef otherwise.
29
30  $cache->set($key => $value)
31    Stores the given key-value pair.
32
33  $cache->remove($key)
34    Removes data associated to the given key and returns the old value, if
35    any.
36
37  $cache->clear($key)
38    Removes all entries from the cache.
39
40AUTHOR
41    Kazuho Oku
42
43SEE ALSO
44    Cache
45
46    Cache::Ref
47
48    Tie::Cache::LRU
49
50LICENSE
51    This program is free software; you can redistribute it and/or modify it
52    under the same terms as Perl itself.
53
54    See <http://www.perl.com/perl/misc/Artistic.html>
55
56