Perl Cache::Memcached not connecting

Adam Dixon adamtdixon at gmail.com
Thu Nov 9 06:42:21 UTC 2006


Hi,
First time playing about with memcached, seems pretty straight
forward, start it up, and start 'set'ing objects into the cache; My
example perl script however doesnt work, I cannot seem to get it to
actually connect (when starting memcached with -vv).
Ive tried this on 3 systems 2 CentOS4 perl 5.8.5 and a FreeBSD 6.1
with perl 5.8.8 both seem to be acting the same.
I installed libevent and memcached from the source downloads and
Cache::Memcached from CPAN

memcache source files 'make test' looks ok to me, 2 subtests skipped
but that seems normal from my googling.
#----------------------
#!/usr/bin/perl
use Cache::Memcached;
use Data::Dumper;
use strict;

my ($obj, $username);
my $mcd = new Cache::Memcached {'servers' => "127.0.0.1:11211"};

print $mcd->set("my_key", "Some value");
Dumper($mcd->get("my_key"));
exit;
#----------------------

This always prints 0, as in, not actually set properly. I dont get any
output when memcached is running under -vv (apart from when it starts
up).

Anyone know what I can try to get this going properly?

Regards
Adam


More information about the memcached mailing list