/[Redis.pre-github]/lib/Redis.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /lib/Redis.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 14 by dpavlin, Sat Mar 21 23:36:26 2009 UTC revision 17 by dpavlin, Sun Mar 22 09:22:39 2009 UTC
# Line 111  sub ping { Line 111  sub ping {
111    
112  sub set {  sub set {
113          my ( $self, $k, $v, $new ) = @_;          my ( $self, $k, $v, $new ) = @_;
114          print $sock ( $new ? "SETNX" : "SET" ) . " $k " . length($v) . "\r\n$v\r\n";          print $sock "SET" . ( $new ? 'NX' : '' ) . " $k " . length($v) . "\r\n$v\r\n";
115          _sock_ok();          _sock_ok();
116  }  }
117    
# Line 227  sub randomkey { Line 227  sub randomkey {
227    
228  =head2 rename  =head2 rename
229    
230    my $ok = $r->rename( 'old-key', 'new-key', $only_if_new );    my $ok = $r->rename( 'old-key', 'new-key', $new );
231    
232  =cut  =cut
233    
# Line 237  sub rename { Line 237  sub rename {
237          _sock_ok();          _sock_ok();
238  }  }
239    
240    =head2 dbsize
241    
242      my $nr_keys = $r->dbsize;
243    
244    =cut
245    
246    sub dbsize {
247            my ( $self ) = @_;
248            print $sock "DBSIZE\r\n";
249            _sock_result();
250    }
251    
252  =head1 AUTHOR  =head1 AUTHOR
253    
254  Dobrica Pavlinusic, C<< <dpavlin at rot13.org> >>  Dobrica Pavlinusic, C<< <dpavlin at rot13.org> >>

Legend:
Removed from v.14  
changed lines
  Added in v.17

  ViewVC Help
Powered by ViewVC 1.1.26