| DBIx-SQLEngine documentation | Contained in the DBIx-SQLEngine distribution. |
DBIx::SQLEngine::Cache::TrivialCache - Trivial Cache Object
use DBIx::SQLEngine::Cache::TrivialCache; $cache = DBIx::SQLEngine::Cache::TrivialCache->new(); $cache->set( $key, $value ); $value = $cache->get( $key ); $cache->clear();
This package provides a very, very simple cache implementation. No expiration or pruning is performed.
For a more full-featured cache, use one of the Cache::Cache classes.
Returns nothing.
For a more full-featured cache, see Cache::Cache.
For more about the Cache classes, see DBIx::SQLEngine::Record::Trait::Cache.
For more about the Record classes, see DBIx::SQLEngine::Record::Class.
See DBIx::SQLEngine for the overall interface and developer documentation.
See DBIx::SQLEngine::Docs::ReadMe for general information about this distribution, including installation and license information.
| DBIx-SQLEngine documentation | Contained in the DBIx-SQLEngine distribution. |
package DBIx::SQLEngine::Cache::TrivialCache; ########################################################################
########################################################################
sub new { my $class = shift; bless { @_ }, $class } ########################################################################
sub get_namespace { "Trivial" } ########################################################################
sub get { ($_[0])->{ $_[1] } } sub set { ($_[0])->{ $_[1] } = $_[2] } sub clear { %{ $_[0] } = () } ######################################################################## ########################################################################
######################################################################## 1;