1Cache::Simple::TimedExpUisreyr(3C)ontributed Perl DocumeCnatcahtei:o:nSimple::TimedExpiry(3)
2
3
4
6 Cache::Simple::TimedExpiry
7
8 EXAMPLE
9 package main;
10
11 use strict;
12 use warnings;
13 $,=' '; $|++;
14
15 use Cache::Simple::TimedExpiry;
16 my $h = Cache::Simple::TimedExpiry->new;
17
18 $h->set( DieQuick => "No duration!", 0);
19 print $h->elements;
20 do { $h->set($_,"Value of $_", 1); sleep 2;}
21 for qw(Have a nice day you little monkey);
22
23
24 print $h->elements; $h->dump; sleep 4; print $h->elements; $h->dump;
25
26 print time;
27
28 new
29 Set up a new cache object
30
31 expire_after SECONDS
32 Set the cache's expiry policy to expire entries after SECONDS seconds.
33 Setting this changes the expiry policy for pre-existing cache entries
34 and for new ones.
35
36 has_key KEY
37 Return true if the cache has an entry with the key KEY
38
39 fetch KEY
40 Return the cache entry with key KEY. Returns undef if there is no such
41 entry
42
43 (Can also be called as get)
44
45 store KEY VALUE
46 Store VALUE in the cache with accessor KEY. Expire it from the cache
47 at or after EXPIRYTIME.
48
49 (Can also be called as set)
50
52 Jesse Vincent <jesse@bestpractical.com> Some of the heavy lifting was
53 designed by Robert Spier <rspier@pobox.com>
54
55 Copyright 2004 Jesse Vincent <jesse@bestpractical.com>
56
57
58
59perl v5.32.1 2021-01-26 Cache::Simple::TimedExpiry(3)