| Arch::SharedCache(3pm) | User Contributed Perl Documentation | Arch::SharedCache(3pm) |
Arch::SharedCache - a synchronized data structure (map) for IPC
use Arch::SharedCache;
my $cache = Arch::SharedCache->new(
dir => '/tmp/dir-listings',
max_size => 100,
expiration => 600, # 10 minutes
);
sub ls_long { scalar `ls -l $_[0]` }
my $user_dir = '/usr/share';
$cache->store($user_dir => ls_long($user_dir));
$cache->fetch_store(sub { ls_long($_[0]) }, qw(/tmp /bin /usr/share));
printf "Cached listing of $user_dir:\n%s", $cache->fetch($user_dir);
$cache->delete($user_dir);
# examine /tmp/dir-listings/ after running this script
# see also synopsys of Arch::SharedIndex
Arch::SharedCache provides an Arch::SharedIndex implementation using a single file per value.
The following methods are available:
new.
Other methods are documented in Arch::SharedIndex.
Awaiting for your reports.
Mikhael Goikhman (migo@homemail.com--Perl-GPL/arch-perl--devel).
Enno Cramer (uebergeek@web.de--2003/arch-perl--devel).
For more information, see Arch::SharedIndex.
| 2005-09-17 | perl v5.20.2 |