anubis has asked for the wisdom of the Perl Monks concerning the following question:

Hello Monks, I'm seeking your wisdom for a way to loop through all configured values in an IPC::Cache object; or if there's no way to do this, an example of how I can replace it with something similar. I need to store a cache of values in memory which is read across multiple processes which is why I originally chose IPC::Cache. Thanks Anubis.

Replies are listed 'Best First'.
Re: Loop through IPC::Cache
by Khen1950fx (Canon) on Aug 02, 2011 at 22:36 UTC
    I haven't had a call to use one of the Cache modules yet, but I would try something like this:
    #!/usr/bin/perl use strict; use warnings; use Cache::MemoryBackend; use Data::Dumper::Concise; my $backend = new Cache::MemoryBackend( '/root/Desktop/tmp/FileCache', 2, 000); $backend->store( 'Animal', 'dog' ); $backend->store( 'Animal', 'raccoon'); print Dumper($backend->get_keys('Animal'));