Skip to content

Commit 449d2b3

Browse files
committed
Update documentation for incr/decr that require a numeric value now.
1 parent 49f983f commit 449d2b3

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

lib/Cache/Memcached/Fast.pm

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ our $VERSION = '0.15';
8080
print "OK\n" if $memd->decr('nkey', 3) == 12;
8181
8282
my @counters = qw(c1 c2);
83+
$memd->set_multi(map { [$_, 0] } @counters, 'c3', 'c4');
8384
$memd->incr_multi(['c3', 2], @counters, ['c4', 10]);
8485
8586
# Retrieve values.
@@ -983,10 +984,10 @@ B<gets> command first appeared in B<memcached> 1.2.4.
983984
$memd->incr($key);
984985
$memd->incr($key, $increment);
985986
986-
Increment the value for the I<$key>. If current value is not a
987-
number, zero is assumed. An optional I<$increment> should be a
988-
positive integer, when not given 1 is assumed. Note that the server
989-
doesn't check for overflow.
987+
Increment the value for the I<$key>. Starting with B<memcached> 1.3.3
988+
I<$key> should be set to a number or the command will fail. An
989+
optional I<$increment> should be a positive integer, when not given 1
990+
is assumed. Note that the server doesn't check for overflow.
990991
991992
I<Return:> unsigned integer, new value for the I<$key>, or false for
992993
negative server reply, or I<undef> in case of some error.
@@ -1028,12 +1029,13 @@ learn what the result value is.
10281029
$memd->decr($key);
10291030
$memd->decr($key, $decrement);
10301031
1031-
Decrement the value for the I<$key>. If current value is not a
1032-
number, zero is assumed. An optional I<$decrement> should be a
1033-
positive integer, when not given 1 is assumed. Note that the server
1034-
I<does> check for underflow, attempt to decrement the value below zero
1035-
would set the value to zero. Similar to L<DBI|DBI>, zero is returned
1036-
as I<"0E0">, and evaluates to true in a boolean context.
1032+
Decrement the value for the I<$key>. Starting with B<memcached> 1.3.3
1033+
I<$key> should be set to a number or the command will fail. An
1034+
optional I<$decrement> should be a positive integer, when not given 1
1035+
is assumed. Note that the server I<does> check for underflow, attempt
1036+
to decrement the value below zero would set the value to zero.
1037+
Similar to L<DBI|DBI>, zero is returned as I<"0E0">, and evaluates to
1038+
true in a boolean context.
10371039
10381040
I<Return:> unsigned integer, new value for the I<$key>, or false for
10391041
negative server reply, or I<undef> in case of some error.

0 commit comments

Comments
 (0)