Redis::hiredis - interact with Redis using the hiredis client.
use Redis::hiredis; my $redis = Redis::hiredis->new(); $redis->connect('127.0.0.1', 6379); $redis->command([qw(set foo bar)]); my $val = $redis->command([qw(get foo)]);
Redis::hiredis is a simple wrapper around Salvatore Sanfilippo's hiredis C client that allows connecting and sending any command just like you would from a command line Redis client.
Redis::hiredis
Creates a new Redis::hiredis object.
$hostname is the hostname of the Redis server to connect to
$hostname
$port is the port to connect on. Default 6379
$port
$command is an array ref of the command and parameters you would like to send to Redis ex:
$command
[qw( set foo bar )]
command will return a scalar value which will either be an integer, string or an array ref (if multiple values are returned).
The Redis command reference can be found here: http://code.google.com/p/redis/wiki/CommandReference
Documentation on the hiredis client can be found here: http://github.com/antirez/hiredis
To install Redis::hiredis, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Redis::hiredis
CPAN shell
perl -MCPAN -e shell install Redis::hiredis
For more information on module installation, please visit the detailed CPAN module installation guide.