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";
$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<< <dpavlin at rot13.org> >>
use warnings;
use strict;
-use Test::More tests => 55;
+use Test::More tests => 56;
use lib 'lib';
ok( $o->lpush( 'test-list' => 'foo' ), 'lpush' );
+cmp_ok( $o->llen('test-list'), '==', 2, 'llen' );
ok( $o->quit, 'quit' );