From 17bcbd7825f411e1b55e15b4e034433a9b1c4811 Mon Sep 17 00:00:00 2001 From: Dobrica Pavlinusic Date: Sun, 22 Mar 2009 09:46:14 +0000 Subject: [PATCH] lpush git-svn-id: svn+ssh://llin/home/dpavlin/private/svn/Redis@19 447b33ff-793d-4489-8442-9bea7d161be5 --- lib/Redis.pm | 11 +++++++++++ t/01-Redis.t | 3 ++- 2 files changed, 13 insertions(+), 1 deletion(-) 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' ); -- 2.20.1