--- lib/Redis.pm 2009/09/12 15:08:59 61
+++ lib/Redis.pm 2010/03/17 18:22:09 69
@@ -4,7 +4,7 @@
use strict;
use IO::Socket::INET;
-use Data::Dump qw/dump/;
+use Data::Dumper;
use Carp qw/confess/;
=head1 NAME
@@ -13,14 +13,14 @@
=cut
-our $VERSION = '0.0801';
+our $VERSION = '1.2001';
=head1 DESCRIPTION
Pure perl bindings for L
-This version support git version 0.08 or later of Redis available at
+This version supports protocol 1.2 or later of Redis available at
L
@@ -61,6 +61,13 @@
sadd => 1, srem => 1,
sismember => 1,
echo => 1,
+ getset => 1,
+ smove => 1,
+ zadd => 1,
+ zrem => 1,
+ zscore => 1,
+ zincrby => 1,
+ append => 1,
};
# we don't want DESTROY to fallback into AUTOLOAD
@@ -70,12 +77,14 @@
sub AUTOLOAD {
my $self = shift;
+ use bytes;
+
my $sock = $self->{sock} || die "no server connected";
my $command = $AUTOLOAD;
$command =~ s/.*://;
- warn "## $command ",dump(@_) if $self->{debug};
+ warn "## $command ",Dumper(@_) if $self->{debug};
my $send;
@@ -126,7 +135,7 @@
}
if ( $type eq '-' ) {
- confess $result;
+ confess "[$command] $result";
} elsif ( $type eq '+' ) {
return $result;
} elsif ( $type eq '$' ) {
@@ -147,7 +156,7 @@
my $v;
if ( $len > 0 ) {
read($self->{sock}, $v, $len) || die $!;
- warn "<< ",dump($v),$/ if $self->{debug};
+ warn "<< ",Dumper($v),$/ if $self->{debug};
}
my $crlf;
read($self->{sock}, $crlf, 2); # skip cr/lf
@@ -166,7 +175,7 @@
$list[ $_ ] = $self->__read_bulk( substr(<$sock>,1,-2) );
}
- warn "## list = ", dump( @list ) if $self->{debug};
+ warn "## list = ", Dumper( @list ) if $self->{debug};
return @list;
}
@@ -410,7 +419,7 @@
=head1 COPYRIGHT & LICENSE
-Copyright 2009 Dobrica Pavlinusic, all rights reserved.
+Copyright 2009-2010 Dobrica Pavlinusic, all rights reserved.
This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.