Text::Template::Simple::Cache - Cache manager


Text-Template-Simple documentation  | view source Contained in the Text-Template-Simple distribution.

Index


NAME

Top

Text::Template::Simple::Cache - Cache manager

SYNOPSIS

Top

TODO

DESCRIPTION

Top

This document describes version 0.83 of Text::Template::Simple::Cache released on 9 February 2011.

Cache manager for Text::Template::Simple.

METHODS

Top

new PARENT_OBJECT

Constructor. Accepts a Text::Template::Simple object as the parameter.

type

Returns the type of the cache.

reset

Resets the in-memory cache and deletes all cache files, if you are using a disk cache.

dumper TYPE

   $template->cache->dumper( $type, \%opt );

TYPE can either be structure or ids. dumper accepts some arguments as a hashref:

   $template->cache->dumper( $type, \%opt );

structure

Returns a string version of the dumped in-memory or disk-cache. Cache is dumped via Data::Dumper. Deparse option is enabled for in-memory cache.

Early versions of Data::Dumper don' t have a Deparse method, so you may need to upgrade your Data::Dumper or disable deparse-ing if you want to use this method.

ids

Returns a list including the names (ids) of the templates in the cache.

id

Gets/sets the cache id.

size

Returns the total cache (disk or memory) size in bytes. If memory cache is used, then you must have Devel::Size installed on your system to get the size of the data structure inside memory.

has data => TEMPLATE_DATA

has id => TEMPLATE_ID

This method can be called with data or id named parameter. If you use the two together, id will be used:

   if ( $template->cache->has( id => 'e369853df766fa44e1ed0ff613f563bd' ) ) {
      print "ok!";
   }

or

   if ( $template->cache->has( data => q~Foo is <%=$bar%>~ ) ) {
      print "ok!";
   }

hit

TODO

populate

TODO

AUTHOR

Top

Burak Gursoy <burak@cpan.org>.

COPYRIGHT

Top

LICENSE

Top

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.12.1 or, at your option, any later version of Perl 5 you may have available.


Text-Template-Simple documentation  | view source Contained in the Text-Template-Simple distribution.