7 use Data::Dump qw/dump/;
11 Redis - The great new Redis!
15 our $VERSION = '0.01';
20 Pure perl bindings for L<http://code.google.com/p/redis/>
36 my $server = '127.0.0.1:6379';
43 warn "# opening socket to $server";
45 $sock ||= IO::Socket::INET->new(
53 =head1 Connection Handling
64 close( $sock ) || warn $!;
69 $r->ping || die "no server?";
74 print $sock "PING\r\n";
76 die "ping failed, got ", dump($pong) unless $pong eq "+PONG\r\n";
79 =head1 Commands operating on string values
83 $r->set( foo => 'bar' );
88 my ( $self, $k, $v ) = @_;
89 print $sock "SET $k " . length($v) . "\r\n$v\r\n";
91 die dump($ok) unless $ok eq "+OK\r\n";
96 my $value = $r->get( 'foo' );
101 my ( $self, $k ) = @_;
102 print $sock "GET $k\r\n";
105 read($sock, $v, $len) || die $!;
111 Dobrica Pavlinusic, C<< <dpavlin at rot13.org> >>
115 Please report any bugs or feature requests to C<bug-redis at rt.cpan.org>, or through
116 the web interface at L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Redis>. I will be notified, and then you'll
117 automatically be notified of progress on your bug as I make changes.
124 You can find documentation for this module with the perldoc command.
129 You can also look for information at:
133 =item * RT: CPAN's request tracker
135 L<http://rt.cpan.org/NoAuth/Bugs.html?Dist=Redis>
137 =item * AnnoCPAN: Annotated CPAN documentation
139 L<http://annocpan.org/dist/Redis>
143 L<http://cpanratings.perl.org/d/Redis>
147 L<http://search.cpan.org/dist/Redis>
152 =head1 ACKNOWLEDGEMENTS
155 =head1 COPYRIGHT & LICENSE
157 Copyright 2009 Dobrica Pavlinusic, all rights reserved.
159 This program is free software; you can redistribute it and/or modify it
160 under the same terms as Perl itself.