X-Git-Url: http://git.rot13.org/?p=perl-Redis.git;a=blobdiff_plain;f=lib%2FRedis.pm;h=5a62fbf117299316d63b906848fa3896467bcfdf;hp=ba874887cb451aa96b91c7e169775945b679384f;hb=9cfdc80967211c3b14fb981b5e0b012f43447599;hpb=17bcbd7825f411e1b55e15b4e034433a9b1c4811 diff --git a/lib/Redis.pm b/lib/Redis.pm index ba87488..5a62fbf 100644 --- a/lib/Redis.pm +++ b/lib/Redis.pm @@ -75,6 +75,12 @@ sub _sock_ok { confess dump($ok) unless $ok eq "+OK\r\n"; } +sub _sock_send { + my $self = shift; + print $sock join(' ',@_) . "\r\n"; + _sock_result(); +} + sub _sock_send_bulk { my ( $self, $command, $key, $value ) = @_; print $sock "$command $key " . length($value) . "\r\n$value\r\n"; @@ -279,6 +285,17 @@ sub lpush { $self->_sock_send_bulk('LPUSH', $key, $value); } +=head2 llen + + $r->llen( $key ); + +=cut + +sub llen { + my ( $self, $key ) = @_; + $self->_sock_send( 'llen', $key ); +} + =head1 AUTHOR Dobrica Pavlinusic, C<< >>