开发者

Operation hmset() takes forever [closed]

开发者 https://www.devze.com 2023-03-31 14:08 出处:网络
This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time,or an extraordinarily narrow situation that is not generally applic
This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center. Closed 11 years ago.

UPD: The code works just fine on a newer Redis module version: 1.904 vs 1.2001.

I开发者_高级运维'm trying to use Redis module from CPAN. It works OK when setting/getting scalar keys, however, I can't get hashes to work.

Here's my sample program:

#!/usr/bin/perl -w

use strict;
use Redis;

my $red = Redis->new();
print "use\n";
$red->hmset(foo=>bar=>1, baz=>2);
print "set\n";
print "$_\n" for $red->hmget("foo", "bar", "baz");

And it hangs after printing "use".

Just using hmset/get from redis-cli works fine.

What's wrong with this code, and how should I deal with redis hashes from perl?


It turned out that the problem was in an old enough version of the Redis module. On another server the code I've posted worked as expected.

The versions in question are 1.904 (works) and 1.2001 (does not).

0

精彩评论

暂无评论...
验证码 换一张
取 消