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).
Get or set cache for this object.
Cache will be cleared on any destructive operation performed on this object.
All the rest of methods are defined to satisfy API for
tie() function. They call appropriate methods of underlying Tie::IxHash(3) object.
<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.