PPI::Cache - Provides document caching for PPI
# Load the default cache use PPI::Cache ':default'; # Manually create a cache my $Cache = PPI::Cache->new( path => '/var/cache/perl/class-PPI', readonly => 1, );
PPI::Cache provides the default caching functionality for PPI.
PPI::Cache
It integrates automatically with PPI itself. Once enabled, any attempt to load a document from the filesystem will be cached via cache.
The path accessor returns the path on the local filesystem that is the root of the cache.
path
The readonly accessor returns true if documents should not be written to the cache.
readonly
The get_document method checks to see if a Document is stored in the cache and retrieves it if so.
get_document
The store_document method takes a PPI::Document as argument and explicitly adds it to the cache.
store_document
Returns true if saved, or undef (or dies) on error.
undef
FIXME (make this return either one or the other, not both)
- Finish the basic functionality
- Add support for use PPI::Cache auto-setting $PPI::Document::CACHE
See the support section in the main module
Adam Kennedy, http://ali.as/, cpan@ali.as
Copyright (c) 2005 Adam Kennedy. All rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
The full text of the license can be found in the LICENSE file included with this module.
To install PPI, copy and paste the appropriate command in to your terminal.
cpanm
cpanm PPI
CPAN shell
perl -MCPAN -e shell install PPI
For more information on module installation, please visit the detailed CPAN module installation guide.