]>
git.saurik.com Git - redis.git/blob - client-libraries/perl/lib/Redis/List.pm
6 use base qw
/Redis Tie::Array/;
10 Redis::List - tie perl arrays into Redis lists
14 tie @a, 'Redis::List', 'name';
20 my ($class,$name) = @_;
21 my $self = $class->new;
22 $self->{name
} = $name;
23 bless $self => $class;
27 my ($self,$index) = @_;
28 $self->lindex( $self->{name
}, $index );
33 $self->llen( $self->{name
} );
37 my ($self,$index,$value) = @_;
38 $self->lset( $self->{name
}, $index, $value );
42 my ($self,$count) = @_;
43 $self->ltrim( $self->{name
}, 0, $count );
44 # if $count > $self->FETCHSIZE;
49 $self->del( $self->{name
} );
54 $self->rpush( $self->{name
}, $_ ) foreach @_;
59 $self->lpop( $self->{name
} );
64 $self->lpush( $self->{name
}, $_ ) foreach @_;
71 $self->lrange( $self->{name
}, $offset, $length );
76 my ($self,$count) = @_;
77 $self->rpush( $self->{name
}, '' ) foreach ( $self->FETCHSIZE .. ( $count - 1 ) );