From: Dobrica Pavlinusic Date: Sun, 22 Mar 2009 09:46:14 +0000 (+0000) Subject: lpush X-Git-Tag: 0.0801~44 X-Git-Url: http://git.rot13.org/?p=perl-Redis.git;a=commitdiff_plain;h=17bcbd7825f411e1b55e15b4e034433a9b1c4811;ds=inline lpush git-svn-id: svn+ssh://llin/home/dpavlin/private/svn/Redis@19 447b33ff-793d-4489-8442-9bea7d161be5 --- diff --git a/lib/Redis.pm b/lib/Redis.pm index 484e9b1..ba87488 100644 --- a/lib/Redis.pm +++ b/lib/Redis.pm @@ -268,6 +268,17 @@ sub rpush { $self->_sock_send_bulk('RPUSH', $key, $value); } +=head2 lpush + + $r->lpush( $key, $value ); + +=cut + +sub lpush { + my ( $self, $key, $value ) = @_; + $self->_sock_send_bulk('LPUSH', $key, $value); +} + =head1 AUTHOR Dobrica Pavlinusic, C<< >> diff --git a/t/01-Redis.t b/t/01-Redis.t index 2c2ecde..0eace15 100755 --- a/t/01-Redis.t +++ b/t/01-Redis.t @@ -3,7 +3,7 @@ use warnings; use strict; -use Test::More tests => 54; +use Test::More tests => 55; use lib 'lib'; @@ -82,6 +82,7 @@ diag "Commands operating on lists"; ok( $o->rpush( 'test-list' => 'foo' ), 'rpush' ); +ok( $o->lpush( 'test-list' => 'foo' ), 'lpush' );