/[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 41 by dpavlin, Sun Mar 22 18:42:21 2009 UTC revision 51 by dpavlin, Mon Mar 23 11:44:25 2009 UTC
# Line 186  sub set { Line 186  sub set {
186    
187  sub get {  sub get {
188          my $self = shift;          my $self = shift;
189          $self->_sock_result_bulk('GET', @_);          $self->_sock_result_bulk('GET',@_);
190    }
191    
192    =head2 mget
193    
194      my @values = $r->get( 'foo', 'bar', 'baz' );
195    
196    =cut
197    
198    sub mget {
199            my $self = shift;
200            $self->_sock_result_bulk_list('MGET',@_);
201  }  }
202    
203  =head2 incr  =head2 incr
# Line 258  sub type { Line 269  sub type {
269    
270  sub keys {  sub keys {
271          my ( $self, $glob ) = @_;          my ( $self, $glob ) = @_;
272          return split(/\s/, $self->_sock_result_bulk( 'KEYS', $glob ));          my $keys = $self->_sock_result_bulk( 'KEYS', $glob );
273            return split(/\s/, $keys) if $keys;
274            return () if wantarray;
275  }  }
276    
277  =head2 randomkey  =head2 randomkey
# Line 523  sub flushall { Line 536  sub flushall {
536          $self->_sock_send_ok('flushall');          $self->_sock_send_ok('flushall');
537  }  }
538    
539    =head1 Sorting
540    
541    =head2 sort
542    
543      $r->sort("key BY pattern LIMIT start end GET pattern ASC|DESC ALPHA');
544    
545    =cut
546    
547    sub sort {
548            my ( $self, $sort ) = @_;
549            $self->_sock_result_bulk_list( "SORT $sort" );
550    }
551    
552    =head1 Persistence control commands
553    
554    =head2 save
555    
556      $r->save;
557    
558    =cut
559    
560    sub save {
561            my $self = shift;
562            $self->_sock_send_ok( 'SAVE' );
563    }
564    
565    =head2 bgsave
566    
567      $r->bgsave;
568    
569    =cut
570    
571    sub bgsave {
572            my $self = shift;
573            $self->_sock_send_ok( 'BGSAVE' );
574    }
575    
576    =head2 lastsave
577    
578      $r->lastsave;
579    
580    =cut
581    
582    sub lastsave {
583            my $self = shift;
584            $self->_sock_send( 'LASTSAVE' );
585    }
586    
587    =head2 shutdown
588    
589      $r->shutdown;
590    
591    =cut
592    
593    sub shutdown {
594            my $self = shift;
595            $self->_sock_send( 'SHUTDOWN' );
596    }
597    
598    =head1 Remote server control commands
599    
600    =head2 info
601    
602      my $info_hash = $r->info;
603    
604    =cut
605    
606    sub info {
607            my $self = shift;
608            my $info = $self->_sock_result_bulk( 'INFO' );
609            my $hash;
610            foreach my $l ( split(/\r\n/, $info ) ) {
611                    my ($n,$v) = split(/:/, $l, 2);
612                    $hash->{$n} = $v;
613            }
614            return $hash;
615    }
616    
617  =head1 AUTHOR  =head1 AUTHOR
618    
619  Dobrica Pavlinusic, C<< <dpavlin at rot13.org> >>  Dobrica Pavlinusic, C<< <dpavlin at rot13.org> >>

Legend:
Removed from v.41  
changed lines
  Added in v.51

  ViewVC Help
Powered by ViewVC 1.1.26