my $cache = new Cache::FileCache( ); my $result = $cache->get( "result" ); if ( not defined $result { $result = expensive_function(); $cache->set( "result", $result, "1 hour" ); }