Log::Message::JSON::Hash - Tie::IxHash(3) wrapper supporting storing cache
use Log::Message::JSON::Hash; use JSON; tie my %hash, "Log::Message::JSON::Hash"; # fill %hash... tied(%hash)->cache = encode_json(\%hash); # ... print tied(%hash)->cache;
This class is a proxy to Tie::IxHash(3). It's a valid class to tie hash to, and above this the class adds possibility of storing a cache.
The cache is cleared on every destructive operation (storing an element, deleting an element and clearing whole hash).
new()
Constructor.
cache()
cache($data)
Get or set cache for this object.
Cache will be cleared on any destructive operation performed on this object.
tie()
All the rest of methods are defined to satisfy API for tie() function. They call appropriate methods of underlying Tie::IxHash(3) object.
Stanislaw Klekot, <cpan at jarowit.net>
<cpan at jarowit.net>
Copyright 2013 Stanislaw Klekot.
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.
Tie::IxHash(3), Tie::Hash(3), tie() in perlfunc(1)
To install Log::Message::JSON, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Log::Message::JSON
CPAN shell
perl -MCPAN -e shell install Log::Message::JSON
For more information on module installation, please visit the detailed CPAN module installation guide.