The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Redis::hiredis - interact with Redis using the hiredis client.

SYNOPSIS

  use Redis::hiredis;
  my $redis = Redis::hiredis->new();
  $redis->connect('127.0.0.1', 6379);
  $redis->command('set foo bar');
  my $val = $redis->command('get foo');

DESCRIPTION

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.

NOTE Versions >= 0.9.2 are not compatible with prior versions

METHODS

new()

Creates a new Redis::hiredis object.

connect( $hostname, $port )

$hostname is the hostname of the Redis server to connect to

$port is the port to connect on. Default 6379

command( $command )

$command is a string identical to what you would pass using the official redis cli

  '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).

SEE ALSO

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