Tie::Redis - Connect perl data structures to Redis
version 0.26
use Tie::Redis; tie my %r, "Tie::Redis"; $r{foo} = 42; print $r{foo}; # 42, persistently
This allows basic access to Redis from Perl using tie, so it looks just like a a hash or array.
Please think carefully before using this, the tie interface has quite a performance overhead and the error handling is not that great. Using AnyEvent::Redis or Redis directly is recommended.
Tie::Redis provides an interface to the top level Redis "hash table"; depending on the type of key you access this then returns a value tied to Tie::Redis::Hash, Tie::Redis::List, Tie::Redis::Scalar or a set type (unfortunately, these aren't yet implemented).
If an error occurs these types will throw an exception, therefore you may want to surround your Redis accessing code with an eval block (or use Try::Tiny).
eval
There are some cases where Redis and Perl types do not match, for example empty lists in Redis have a type of "none", therefore if you empty a list and then try to access it again it will no longer be an array reference.
Autovivification currently doesn't correctly work, I believe some of this may be fixable but haven't yet fully investigated.
App::redisp
A redis shell in Perl and the main reason I wrote this module.
Tie::Redis::Attributes
An experimental attribute based interface.
Redis
Another Redis API.
David Leadbeater <dgl@dgl.cx>
This software is copyright (c) 2011 by David Leadbeater.
This program is free software. It comes without any warranty, to the extent permitted by applicable law. You can redistribute it and/or modify it under the terms of the Beer-ware license revision 42.
To install Tie::Redis, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Tie::Redis
CPAN shell
perl -MCPAN -e shell install Tie::Redis
For more information on module installation, please visit the detailed CPAN module installation guide.