maybe, just maybe you can use Cache::SharedMemoryCache
have one program that that stays running to hold the cache in memory while other programs come and go.
# holdcache.pl use Cache::SharedMemoryCache; my %cache_options_= ( 'namespace' => 'MyNamespace', ); my $c = Cache::SharedMemoryCache->new( \%cache_options ) or die( "Couldn't instantiate SharedMemoryCache" ); while (1) { sleep 300; } __END__
should do to keep the cache open.
$ perl holdcache.pl & $ perl -e 'use Cache::SharedMemoryCache;$c=Cache::SharedMemoryCache->n +ew({namespace=>"MyNamespace"}) or die;$c->set("foo",1);' $ perl -e 'use Cache::SharedMemoryCache;$c=Cache::SharedMemoryCache->n +ew({namespace=>"MyNamespace"}) or die;$x=$c->get("foo");print $x,$/' 1
presto!
In reply to Re: Re: Re: Cache::MemoryCache
by zengargoyle
in thread Cache::MemoryCache
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |