$self;
}
+sub _sock_result {
+ my $result = <$sock>;
+ warn "# result: ",dump( $result );
+ $result =~ s{\r\n$}{} || warn "can't find cr/lf";
+ return $result;
+}
+
=head1 Connection Handling
=head2 quit
=cut
-sub sock_result {
- my $result = <$sock>;
- warn "# result: ",dump( $result );
- $result =~ s{\r\n$}{} || warn "can't find cr/lf";
- return $result;
-}
sub incr {
} else {
print $sock "INCR $key\r\n";
}
- sock_result();
+ _sock_result();
}
=head2 decr
} else {
print $sock "DECR $key\r\n";
}
- sock_result();
+ _sock_result();
}
=head2 exists
sub exists {
my ( $self, $key ) = @_;
print $sock "EXISTS $key\r\n";
- sock_result();
+ _sock_result();
}
=head2 del
sub del {
my ( $self, $key ) = @_;
print $sock "DEL $key\r\n";
- sock_result();
+ _sock_result();
+}
+
+=head2 type
+
+ $r->type( 'key' ); # = string
+
+=cut
+
+sub type {
+ my ( $self, $key ) = @_;
+ print $sock "type $key\r\n";
+ _sock_result();
}
=head1 AUTHOR