Cache::Memcached works "well" on Win32 for me, except that there seems to be a newline issue when connecting to a Linux memcached. Connecting to the local memcached makes the following program pass without warnings:

#!/usr/bin/env perl -w use strict; use Test::More; use Cache::Memcached; #my $testaddr = "aliens:11211"; my $testaddr = "localhost:11211"; plan tests => 20; my $memd = Cache::Memcached->new({ servers => [ $testaddr ], namespace => "Cache::Memcached::t/$$/" . (time() % 100) . "/", }); isa_ok($memd, 'Cache::Memcached'); my $memcached_version; #eval { # require version; # die "version too old" unless $version::VERSION >= 0.77; # $memcached_version = # version->parse( # $memd->stats('misc')->{hosts}->{$testaddr}->{misc}->{vers +ion} # ); # diag("Server version: $memcached_version") if $memcached_version; #}; #diag $@ if $@; ok($memd->set("key1", "val1"), "set key1 as val1"); is($memd->get("key1"), "val1", "get key1 is val1"); ok(! $memd->add("key1", "val-replace"), "add key1 properly failed"); ok($memd->add("key2", "val2"), "add key2 as val2"); is($memd->get("key2"), "val2", "get key2 is val2"); ok($memd->replace("key2", "val-replace"), "replace key2 as val-replace +"); is($memd->get("key2"), "val-replace", "get key2 is val-replace"); ok(! $memd->replace("key-noexist", "bogus"), "replace key-noexist prop +erly failed"); ok($memd->delete("key1"), "delete key1"); ok(! $memd->get("key1"), "get key1 properly failed"); SKIP: { skip "Could not parse server version; version.pm 0.77 required", 7 unless $memcached_version; skip "Only using prepend/append on memcached >= 1.2.4, you have $mem +cached_version", 7 unless $memcached_version && $memcached_version >= v1.2.4; ok(! $memd->append("key-noexist", "bogus"), "append key-noexist prop +erly failed"); ok(! $memd->prepend("key-noexist", "bogus"), "prepend key-noexist pr +operly failed"); ok($memd->set("key3", "base"), "set key3 to base"); ok($memd->append("key3", "-end"), "appended -end to key3"); ok($memd->get("key3", "base-end"), "key3 is base-end"); ok($memd->prepend("key3", "start-"), "prepended start- to key3"); ok($memd->get("key3", "start-base-end"), "key3 is base-end"); } # also test creating the object with a list rather than a hash-ref my $mem2 = Cache::Memcached->new( servers => [ ], debug => 1, ); isa_ok($mem2, 'Cache::Memcached'); ok($mem2->{debug}, "debug is set on alt constructed instance");

This is using Cache::Memcached 1.28.

I'm using Strawberry Perl, but I doubt that this is the cause:

This is perl, v5.10.0 built for MSWin32-x86-multi-thread Copyright 1987-2007, Larry Wall Perl may be copied only under the terms of either the Artistic License + or the GNU General Public License, which may be found in the Perl 5 source ki +t. Complete documentation for Perl, including FAQ lists, should be found +on this system using "man perl" or "perldoc perl". If you have access to + the Internet, point your browser at http://www.perl.org/, the Perl Home Pa +ge.

In reply to Re^7: Perl Memcached client under Windows XP by Corion
in thread Perl Memcached client under Windows XP by brancusi

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.