Bruno Postle > MKDoc-Core-0.91 > MKDoc::Core::FileCache

Download:
MKDoc-Core-0.91.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Source  

NAME ^

MKDoc::Core::FileCache - Cache::FileCache wrapper for MKDoc::Core

SYNOPSIS ^

  sub cached_foo
  {
      my $key = shift;
      my $foo_cache = MKDoc::Core::FileCache->instance ('foo_cache');
      return $foo_cache->get ($key) || do {
          my $val = compute_expensive_foo ($key);
          $foo_cache->set ($key, $val, "1 day");
          $val;
      };
  }
syntax highlighting: