# # This file is part of Redis # # This software is Copyright
(c) 2013 by Pedro Melo, Damien Krotkine. # # This is free
software, licensed under: # # The Artistic License 2.0 (GPL
Compatible) # package Redis; { $Redis::VERSION = '1.964'; } #
ABSTRACT: Perl binding for Redis database # VERSION # AUTHORITY
use warnings; use strict; use IO::Socket::INET; use
IO::Socket::UNIX; use IO::Select; use IO::Handle; use Fcntl qw(
O_NONBLOCK F_SETFL ); use Errno (); use Data::Dumper; use Carp
qw/confess/; use Encode; use Try::Tiny; use Scalar::Util (); use
constant WIN32 => $^O =~ /mswin32/i; use constant EWOULDBLOCK =>
eval {Errno::EWOULDBLOCK} || -1E9; use constant EAGAIN => eval
{Errno::EAGAIN} || -1E9; use constant EINTR => eval
{Errno::EINTR} || -1E9; sub new { my ($class, %args) = @_; my
$self = bless {}, $class; $self->{debug} = $args{debug} ||
$ENV{REDIS_DEBUG}; ## Deal with REDIS_SERVER ENV if
($ENV{REDIS_SERVER} && !$args{sock} && !$args{server}) { if
($ENV{REDIS_SERVER} =~ m!^/!) { $args{sock} = $ENV{REDIS_SERV