This is a plug-in module that automatically expires memoized values. With this software, users can manage data expiration and ensure that memoized values are regularly cleared to free up memory space.
To set a real-time timeout, use the LIFETIME option with a numeric value in seconds. When a cached data item expires, it will be looked up afresh. You can also use the NUM_USES option to specify the number of times a data item can be accessed before it is discarded and looked up afresh. If both options are specified, data will be discarded from the cache when either expiration condition holds.
Memoize::Expire uses an internal hash to store cached data, but you can supply a tied hash using the HASH option. This allows you to use Memoize::Expire as a layer in between a persistent disk hash and Memoize. For example, you can use DB_File to implement data persistence on disk and Memoize::Expire to enforce data expiration policy.
To use Memoize::Expire, you need to have already installed and familiarized yourself with the Memoize module. Memoize::Expire assumes you have understood the HASH feature, so you should study this feature before using the module.
In summary, Memoize::Expire is a great plug-in module to automate the expiration of memoized values. It is easy to use and provides flexibility to customize the expiration policy. The ability to use a tied hash for a persistent disk cache adds another dimension of usefulness.
Version 1.01: N/A