CC: | baranov [...] corp.mail.ru |
Subject: | Cache::Memcached::GetParser |
Date: | Thu, 29 Nov 2007 15:20:09 +0300 |
To: | bug-Cache-Memcached [...] rt.cpan.org |
From: | Kost <kost [...] ropnet.ru> |
Distribution name and version: Cache-Memcached-1.24
Perl version: 5.8.8
Operating System: FreeBSD 6.2
I've got a such error while testing Cache::Memcached:
'Use of uninitialized value in integer eq (==) at
/usr/local/lib/perl5/site_perl/5.8.8/Cache/Memcached/GetParser.pm line 62'
Steps:
1) Run memcached daemon on 127.0.0.1:11211
2) Start memcached_test.pl
#!/usr/bin/perl -w
use strict;
use Cache::Memcached;
# First of all we create a new class instance of Cache::Memcached:
my $memd = new Cache::Memcached { 'servers' => [ "127.0.0.1:11211" ],
'debug' => 0 };
my $res = $memd->set("my_key", "Some value");
print $res ? 'insert ok' : 'insert error';
# go sleeping for a while....
# while sleeping we stop memcached and system brakes all connections
with daemon (killall memcached)
sleep(10);
# After sleeping we try to read from dead socket...
my $val = $memd->get("my_key");
3) 'Use of uninitialized value in integer eq (==) at
/usr/local/lib/perl5/site_perl/5.8.8/Cache/Memcached/GetParser.pm line 62'
Simple solution:
localhost# diff GetParser.pm GetParser_New.pm
62c62
< if ($res == 0) {
---
Show quoted text
> if (!defined($res) || $res == 0) {