/[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 25 by dpavlin, Sun Mar 22 13:18:11 2009 UTC revision 26 by dpavlin, Sun Mar 22 13:37:49 2009 UTC
# Line 77  sub _sock_result_bulk { Line 77  sub _sock_result_bulk {
77          _sock_read_bulk();          _sock_read_bulk();
78  }  }
79    
80  sub _sock_ok {  sub __sock_ok {
81          my $ok = <$sock>;          my $ok = <$sock>;
82          confess dump($ok) unless $ok eq "+OK\r\n";          confess dump($ok) unless $ok eq "+OK\r\n";
83  }  }
# Line 93  sub _sock_send_ok { Line 93  sub _sock_send_ok {
93          my $self = shift;          my $self = shift;
94          warn "## _sock_send_ok ",dump( @_ );          warn "## _sock_send_ok ",dump( @_ );
95          print $sock join(' ',@_) . "\r\n";          print $sock join(' ',@_) . "\r\n";
96          _sock_ok();          __sock_ok();
97  }  }
98    
99  sub _sock_send_bulk {  sub __sock_send_bulk_raw {
100          my $self = shift;          my $self = shift;
101            warn "## _sock_send_bulk ",dump( @_ );
102          my $value = pop;          my $value = pop;
103          print $sock join(' ',@_) . ' ' . length($value) . "\r\n$value\r\n";          print $sock join(' ',@_) . ' ' . length($value) . "\r\n$value\r\n";
         _sock_ok();  
104  }  }
105    
106    sub _sock_send_bulk {
107            __sock_send_bulk_raw( @_ );
108            __sock_ok();
109    }
110    
111    sub _sock_send_bulk_number {
112            __sock_send_bulk_raw( @_ );
113            my $v = _sock_result();
114            confess $v unless $v =~ m{^\-?\d+$};
115            return $v;
116    }
117    
118  =head1 Connection Handling  =head1 Connection Handling
119    
# Line 349  sub lset { Line 360  sub lset {
360          $self->_sock_send_bulk( 'LSET', $key, $index, $value );          $self->_sock_send_bulk( 'LSET', $key, $index, $value );
361  }  }
362    
363    =head2 lrem
364    
365      $r->lrem( $key, $count, $value );
366    
367    =cut
368    
369    sub lrem {
370            my ( $self, $key, $count, $value ) = @_;
371            $self->_sock_send_bulk_number( 'LREM', $key, $count, $value );
372    }
373    
374  =head1 AUTHOR  =head1 AUTHOR
375    
376  Dobrica Pavlinusic, C<< <dpavlin at rot13.org> >>  Dobrica Pavlinusic, C<< <dpavlin at rot13.org> >>

Legend:
Removed from v.25  
changed lines
  Added in v.26

  ViewVC Help
Powered by ViewVC 1.1.26