in reply to Cache::MemoryCache

What do you mean by "it doesn't work"? The memory cache goes away when the perl program exits. For your example the cache is *always* empty when the script starts. You have to use a FileCache or something similar if you want it to keep its data between calls to your program.