--- lib/Redis.pm 2009/03/21 22:48:46 8 +++ lib/Redis.pm 2009/03/21 22:54:10 9 @@ -150,6 +150,21 @@ return $count; } +=head2 exists + + $r->exists( 'key' ) && print "got key!"; + +=cut + +sub exists { + my ( $self, $key ) = @_; + print $sock "EXISTS $key\r\n"; + my $found = <$sock>; + $found =~ s{\r\n$}{}; + warn "# exists $key = $found"; + return $found; +} + =head1 AUTHOR Dobrica Pavlinusic, C<< >>