Tie::Cache

Tie::Cache is a LRU Cache in Memory implementation module.
Download

Tie::Cache Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Joshua Chamas
  • Publisher web site:
  • http://search.cpan.org/~chamas/Tie-Cache-0.17/Cache.pm

Tie::Cache Tags


Tie::Cache Description

Tie::Cache is a LRU Cache in Memory implementation module. Tie::Cache is a LRU Cache in Memory implementation module.SYNOPSIS use Tie::Cache; tie che, 'Tie::Cache', 100, { Debug => 1 }; tie che2, 'Tie::Cache', { MaxCount => 100, MaxBytes => 50000 }; tie che3, 'Tie::Cache', 100, { Debug => 1 , WriteSync => 0}; # Options ################################################################## # # Debug => 0 - DEFAULT, no debugging output # 1 - prints cache statistics upon destroying # 2 - prints detailed debugging info # # MaxCount => Maximum entries in cache. # # MaxBytes => Maximum bytes taken in memory for cache based on approximate # size of total cache structure in memory # # There is approximately 240 bytes used per key/value pair in the cache for # the cache data structures, so a cache of 5000 entries would take # at approximately 1.2M plus the size of the data being cached. # # MaxSize => Maximum size of each cache entry. Larger entries are not cached. # This helps prevent much of the cache being flushed when # you set an exceptionally large entry. Defaults to MaxBytes/10 # # WriteSync => 1 - DEFAULT, write() when data is dirtied for # TRUE CACHE (see below) # 0 - write() dirty data as late as possible, when leaving # cache, or when cache is being DESTROY'd # ############################################################################ # cache supports normal tied hash functions $cache{1} = 2; # STORE print "$cache{1}n"; # FETCH # FIRSTKEY, NEXTKEY while(($k, $v) = each che) { print "$k: $vn"; } delete $cache{1}; # DELETE che = (); # CLEAR Requirements: · Perl


Tie::Cache Related Software