X-Git-Url: http://git.rot13.org/?p=perl-Redis.git;a=blobdiff_plain;f=lib%2FRedis.pm;h=cb78dc96b9ae8dd8201056be9ecaa3e3a8acb1a7;hp=8fe98d6f4b6dc878d58a5c1fed09e2b51a79cfd2;hb=158e8571dfb13b4cf308b1b00866c6557593336d;hpb=7b6138898abd509437714737a314e455f77bc1e5 diff --git a/lib/Redis.pm b/lib/Redis.pm index 8fe98d6..cb78dc9 100644 --- a/lib/Redis.pm +++ b/lib/Redis.pm @@ -97,8 +97,9 @@ sub _sock_send_ok { } sub _sock_send_bulk { - my ( $self, $command, $key, $value ) = @_; - print $sock "$command $key " . length($value) . "\r\n$value\r\n"; + my $self = shift; + my $value = pop; + print $sock join(' ',@_) . ' ' . length($value) . "\r\n$value\r\n"; _sock_ok(); } @@ -334,9 +335,19 @@ sub ltrim { sub lindex { my ( $self, $key, $index ) = @_; - $self->_sock_result_bulk( 'lindex', $key, $index ); + $self->_sock_result_bulk( 'LINDEX', $key, $index ); } +=head2 lset + + $r->lset( $key, $index, $value ); + +=cut + +sub lset { + my ( $self, $key, $index, $value ) = @_; + $self->_sock_send_bulk( 'LSET', $key, $index, $value ); +} =head1 AUTHOR