Bug#714035: libredis-perl: [sadd] ERR unknown command 'CODE(0x9284f68)'

Peter Baranyi peter.baranyi at gmail.com
Tue Jun 25 02:48:57 UTC 2013


Package: libredis-perl
Version: 2:1.2001-1
Severity: normal

Installed redis server and the perl module, tried the below program and got this error:

cat sample.txt|perl tools/redis.pl sadd db_name;
[sadd] ERR wrong number of arguments for 'sadd' command at /usr/share/perl5/Redis.pm line 139
        Redis::AUTOLOAD('Redis=HASH(0x9828818)', 'db_name', 'first-line-from-sample.txt') called at tools/redis.pl line 26

Then upgraded redis server to the one in backports and the error became:

cat sample.txt|perl tools/redis.pl sadd db_name;
[sadd] ERR unknown command 'CODE(0x9284f68)' at /usr/share/perl5/Redis.pm line 139
        Redis::AUTOLOAD('Redis=HASH(0x90fd818)', 'db_name', 'first-line-from-sample.txt') called at tools/redis.pl line 26

Then I installed the newest redis perl module with cpan, and it worked without any error.

The redis.pl used:

#!/usr/bin/perl -w

use strict;
use Redis;

die "command? database?\n" unless $ARGV[0] and $ARGV[1];

my $redis = Redis->new ( encoding => undef );


if ($ARGV[0] eq 'sadd')
  {
    while (<STDIN>)
      {
        chomp;
        my $data = $_;
        $redis->sadd( $ARGV[1], $data, sub
                        {
                      my ($reply,$error) = @_;

                      if ($error)
                        {
                          warn "got error: $error\n"
                        }
                    }
                  ) or warn "failed to sadd $_\n";
      }
  }
elsif ($ARGV[0] eq 'sismember')
  {
    while (<STDIN>)
      {
        chomp;
        my $check = $_;

        unless ( $redis->sismember( $ARGV[1] => $_ ) )
          {
            print "$_ not found!\n"
          }
      }
  }
else
  {
    die "only command sadd and sismember is supported\n"
  }

$redis->wait_all_responses();


-- System Information:
Debian Release: 6.0.1
  APT prefers oldstable
  APT policy: (500, 'oldstable')
Architecture: i386 (i686)

Kernel: Linux 2.6.32-042stab072.10 (SMP w/1 CPU core)
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/bash

Versions of packages libredis-perl depends on:
ii  perl                   5.10.1-17squeeze6 Larry Wall's Practical Extraction 

libredis-perl recommends no packages.

libredis-perl suggests no packages.

-- no debconf information



More information about the pkg-perl-maintainers mailing list